linuxinstaller/ansible/roles/base/tasks/main.yml

66 lines
2 KiB
YAML
Raw Normal View History

2024-10-13 17:20:18 +02:00
- name: Source les variables dépendantes de la distribution
ansible.builtin.import_tasks: variables.yml
tags: always
2024-10-05 19:16:17 +02:00
- name: Utilisateurs existants
ansible.builtin.getent:
database: passwd
# Si le compte installer_username existe, c'est qu'on est passé par l'installation automatique
# On n'a pas de compte avec sudo, on doit permettre au compte installer de lancer le menu
- name: Sudoers pour {{ installer_username }}
ansible.builtin.copy:
content: |
# Autorise {{ installer_username }} à lancer le menu sans mdp
{{ installer_username }} ALL = NOPASSWD:/opt/libreticmenu/libreticmenu.sh
dest: /etc/sudoers.d/{{ installer_username }}
when: installer_username in getent_passwd.keys()
2024-09-30 19:32:52 +02:00
- name: Installation des packages nécessaires
ansible.builtin.package:
name: "{{ required_packages }}"
- name: Suppression des packages non souhaités
ansible.builtin.package:
name: "{{ remove_packages }}"
state: absent
- name: Installation des flatpak nécessaires
community.general.flatpak:
name: "{{ required_flatpak }}"
method: system
- name: Configuration Mintupdate
ansible.builtin.file:
path: "{{ item }}"
owner: root
group: root
mode: u=rw,g=r,o=r
state: touch
modification_time: preserve
access_time: preserve
loop:
- /var/lib/linuxmint/mintupdate-automatic-removals-enabled
- /var/lib/linuxmint/mintupdate-automatic-upgrades-enabled
- name: Configure GRUB_CMDLINE_LINUX_DEFAULT
ansible.builtin.lineinfile:
state: present
dest: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=""$'
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"'
notify: Update-grub
- name: Configure GRUB options
ansible.builtin.blockinfile:
state: present
path: /etc/default/grub
marker: "# {mark} ANSIBLE MANAGED BLOCK: GRUB options"
block: |
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
notify: Update-grub
2024-10-12 19:36:31 +02:00
- name: Installe element
ansible.builtin.include_tasks: element.yml