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
hosts: pibox
become: true
hosts: pibox
roles:
- role: apt-update-system

View File

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

View File

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