diff options
| author | Antoine Ouvrard <antoine.ouvrard@zextras.fr> | 2023-03-09 16:44:05 +0100 |
|---|---|---|
| committer | Antoine Ouvrard <antoine.ouvrard@zextras.fr> | 2023-03-09 16:44:05 +0100 |
| commit | 38129c2455892386eb8c9171c90154192d5480ac (patch) | |
| tree | fe0a52f9a2763b7248460cc42601dc6923b8184a /ansible_tools/roles/prerequis/tasks/main.yml | |
ajoute les archives
Diffstat (limited to 'ansible_tools/roles/prerequis/tasks/main.yml')
| -rw-r--r-- | ansible_tools/roles/prerequis/tasks/main.yml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/ansible_tools/roles/prerequis/tasks/main.yml b/ansible_tools/roles/prerequis/tasks/main.yml new file mode 100644 index 0000000..df01f35 --- /dev/null +++ b/ansible_tools/roles/prerequis/tasks/main.yml @@ -0,0 +1,58 @@ +--- +# Set Timezone +- name: Set timezone variables + ansible.builtin.copy: + content: 'Europe/Paris' + dest: /etc/timezone + owner: root + group: root + mode: 0644 + backup: true + force: false + notify: + - Update timezone + +# Disable ipv6 +- name: Checking GRUB cmdline + ansible.builtin.shell: "grep 'GRUB_CMDLINE_LINUX_DEFAULT=.*ipv6.disable=1.*' /etc/default/grub" + register: grub_cfg_grep + changed_when: false + failed_when: false + +- name: Disable IPV6 on GRUB cmdline + ansible.builtin.replace: + path: '/etc/default/grub' + regexp: '^GRUB_CMDLINE_LINUX_DEFAULT="((\w.?)*)"$' + replace: 'GRUB_CMDLINE_LINUX_DEFAULT="\1 ipv6.disable=1"' + when: '"ipv6.disable=1" not in grub_cfg_grep.stdout' + +# Remove snap +- name: Stop service snap, if running + ansible.builtin.systemd: + name: snapd + state: stopped + register: unused_disable # on enregistre le retour de la commande pour déclencher l'arret que si le service existe + failed_when: "unused_disable is failed and ('find' not in unused_disable.msg and 'found' not in unused_disable.msg)" + +- name: Uninstall + ansible.builtin.apt: + pkg: + - snapd + - gnome-software-plugin-snap + state: absent + purge: true + +- name: Delete snap directory + ansible.builtin.file: + path: + - ~/snap/ + - /var/cache/snapd/ + state: absent + +# Install LibreOffice +- name: Apt Install Prerequis + ansible.builtin.apt: + update_cache: true + name: + - libreoffice + - net-tools |
