[EVO] Générer les listes de paquets #2

Merged
pulsar merged 1 commits from generateLists into master 2023-09-10 17:36:15 +00:00

View File

@ -29,7 +29,15 @@
name: sudo
become: true
- name: Désinstaller les paquets communs
- name: Construire la liste des paquets à désinstaller
ansible.builtin.set_fact:
apt_remove: "{{ apt_remove + specific }}"
when: specific | length > 0
loop: "{{ lookup('ansible.builtin.varnames', '^apt_remove_.+', wantlist=True) }}"
vars:
specific: "{{ lookup('ansible.builtin.vars', item, default='') }}"
- name: Désinstaller des paquets
ansible.builtin.apt:
state: absent
purge: true
@ -43,7 +51,15 @@
update_cache: true
upgrade: dist
- name: Installer les paquets communs
- name: Construire la liste des paquets à installer
ansible.builtin.set_fact:
apt_install: "{{ apt_install + specific }}"
when: specific | length > 0
loop: "{{ lookup('ansible.builtin.varnames', '^apt_install_.+', wantlist=True) }}"
vars:
specific: "{{ lookup('ansible.builtin.vars', item, default='') }}"
- name: Installer des paquets
ansible.builtin.apt:
name: "{{ apt_install }}"
become: true