This repository has been archived on 2026-05-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
zx_ansible_tools/ansible_tools/roles/prerequis/tasks/main.yml
T
2023-03-09 16:44:05 +01:00

59 lines
1.4 KiB
YAML

---
# 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