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

This commit is contained in:
pulsar89.5 2023-09-10 19:04:22 +02:00
parent 7f39793df7
commit 2ff8124dcf

View File

@ -29,7 +29,15 @@
name: sudo name: sudo
become: true 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: ansible.builtin.apt:
state: absent state: absent
purge: true purge: true
@ -43,7 +51,15 @@
update_cache: true update_cache: true
upgrade: dist 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: ansible.builtin.apt:
name: "{{ apt_install }}" name: "{{ apt_install }}"
become: true become: true