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
|
- name: Update the system
|
||||||
hosts: pibox
|
|
||||||
become: true
|
become: true
|
||||||
|
hosts: pibox
|
||||||
roles:
|
roles:
|
||||||
- role: apt-update-system
|
- role: apt-update-system
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user