feat(packages): Set desired package state in group var

This commit is contained in:
Marty Oehme 2025-02-22 17:11:58 +01:00
parent 55d752ee19
commit b07d7be58d
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 5 additions and 3 deletions

View file

@ -8,6 +8,7 @@ chroot:
void: void:
ansible_host: /mnt/void ansible_host: /mnt/void
ansible_connection: community.general.chroot ansible_connection: community.general.chroot
desired_package_state: latest
interface: interface:
hosts: hosts:

View file

@ -9,14 +9,15 @@
community.general.xbps: community.general.xbps:
name: name:
- keyd - keyd
state: present state: "{{ desired_package_state }}"
notify: installed-keyd notify: installed-keyd
- name: Install many fonts - name: Install many fonts
community.general.xbps: community.general.xbps:
state: present
name: "{{ packages_fonts }}" name: "{{ packages_fonts }}"
state: "{{ desired_package_state }}"
notify: installed-fonts notify: installed-fonts
when: packages_fonts
handlers: handlers:
- name: Activate keyd service - name: Activate keyd service
@ -47,4 +48,4 @@
- name: Install a bunch of base custom stuff - name: Install a bunch of base custom stuff
community.general.xbps: community.general.xbps:
name: "{{ lookup('community.general.merge_variables', '^packages_.*') }}" name: "{{ lookup('community.general.merge_variables', '^packages_.*') }}"
state: present state: "{{ desired_package_state }}"