fix install-packages playbook, use var in loop and undefined not unset
This commit is contained in:
parent
f7966b041e
commit
9088458b5d
@ -1,8 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Update the system
|
||||
hosts: pibox
|
||||
become: true
|
||||
hosts: pibox
|
||||
roles:
|
||||
- role: apt-update-system
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -5,6 +5,6 @@
|
||||
update_cache: true
|
||||
name: "{{ package }}"
|
||||
state: latest
|
||||
failed_when: package is unset
|
||||
failed_when: package is undefined
|
||||
|
||||
...
|
||||
|
Loading…
Reference in New Issue
Block a user