fix: rename roles to use underscores instead of hyphens which was causing the roles not to be found
This commit is contained in:
19
roles/system_maintenance/tasks/main.yml
Executable file
19
roles/system_maintenance/tasks/main.yml
Executable file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: Use appropriate tasks for given distribution
|
||||
ansible.builtin.set_fact:
|
||||
task_distro_file: "{{ ansible_os_family | lower }}.yaml"
|
||||
|
||||
- name: Verify that the distribution is supported
|
||||
become: false
|
||||
ansible.builtin.stat:
|
||||
path: "{{ role_path }}/tasks/{{ task_distro_file }}"
|
||||
register: distro_stat_result
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Fail if the distribution is not supported
|
||||
ansible.builtin.fail:
|
||||
msg: "Unsupported distribution: {{ ansible_os_family }}"
|
||||
when: not distro_stat_result.stat.exists
|
||||
|
||||
- name: Include distribution specific update tasks
|
||||
ansible.builtin.include_tasks: "{{ task_distro_file }}"
|
||||
Reference in New Issue
Block a user