fix install-packages playbook, use var in loop and undefined not unset

This commit is contained in:
c0de 2024-01-04 15:07:20 -06:00
parent f7966b041e
commit 9088458b5d
3 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
--- ---
- name: Update the system - name: Update the system
hosts: pibox
become: true become: true
hosts: pibox
roles: roles:
- role: apt-update-system - role: apt-update-system

View File

@ -1,13 +1,13 @@
--- ---
- name: Install Packages - name: Remove Packages
become: true become: true
hosts: pibox hosts: pibox
tasks: tasks:
- name: Loop over packages_to_install and install them - name: Loop over packages_to_install and install them
ansible.builtin.include_role: ansible.builtin.include_role:
name: apt-install-package name: apt-install-package
loop: packages_to_install loop: "{{ packages_to_install }}"
loop_control: loop_control:
loop_var: package loop_var: package

View File

@ -5,6 +5,6 @@
update_cache: true update_cache: true
name: "{{ package }}" name: "{{ package }}"
state: latest state: latest
failed_when: package is unset failed_when: package is undefined
... ...