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