[EVO] Générer les listes de paquets #2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user