move a lot of configuration around
This commit is contained in:
@@ -3,9 +3,23 @@
|
||||
- name: "Check if task exists for {{ pkg }}"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ role_path }}/tasks/pkgs/{{ pkg }}.yml"
|
||||
register: cpkg_exists
|
||||
register: stat_pkg
|
||||
|
||||
- name: "Check if specialized configuration exists for {{ pkg }}"
|
||||
when:
|
||||
- stat_pkg.exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ role_path }}/tasks/config/{{ pkg }}.yml"
|
||||
register: stat_config
|
||||
|
||||
- name: "Load specialized configuration if it exists for {{ pkg }}"
|
||||
when:
|
||||
- stat_config.exists
|
||||
ansible.builtin.include_tasks:
|
||||
file: "config/{{ pkg }}.yml"
|
||||
|
||||
- name: "Add include task for {{ pkg }}"
|
||||
when: cpkg_exists.exists
|
||||
when:
|
||||
- stat_pkg.exists
|
||||
ansible.builtin.include_tasks:
|
||||
file: "pkgs/{{ pkg }}.yml"
|
||||
|
||||
Reference in New Issue
Block a user