refactor(configuration): add conditional dispatch to task includes
This commit is contained in:
@@ -1,19 +1,23 @@
|
|||||||
---
|
---
|
||||||
- name: Include configuration tasks
|
- name: Include configuration tasks
|
||||||
ansible.builtin.include_tasks: "{{ configuration_task }}"
|
when: configuration_task.when | default(true)
|
||||||
|
ansible.builtin.include_tasks: "{{ configuration_task.file }}"
|
||||||
loop:
|
loop:
|
||||||
- banner.yml
|
- file: banner.yml
|
||||||
- fstab.yml
|
- file: fstab.yml
|
||||||
- locales.yml
|
- file: locales.yml
|
||||||
- ssh.yml
|
- file: ssh.yml
|
||||||
- services.yml
|
- file: services.yml
|
||||||
- grub.yml
|
- file: grub.yml
|
||||||
- encryption.yml
|
- file: encryption.yml
|
||||||
- bootloader.yml
|
when: "{{ system_cfg.luks.enabled | bool }}"
|
||||||
- extras.yml
|
- file: bootloader.yml
|
||||||
- network.yml
|
- file: extras.yml
|
||||||
- users.yml
|
- file: network.yml
|
||||||
- sudo.yml
|
- file: users.yml
|
||||||
- selinux.yml
|
- file: sudo.yml
|
||||||
|
- file: selinux.yml
|
||||||
|
when: "{{ is_rhel | bool }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: configuration_task
|
loop_var: configuration_task
|
||||||
|
label: "{{ configuration_task.file }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user