refactor: use the yml extension for every yaml file
The repository mixed both extensions, the molecule scenario used yml while the role itself used yaml. The yml extension is the one ansible-galaxy and molecule generate, so it is applied throughout and across the sibling roles. The include_tasks calls in tasks/main.yml and tasks/create_unix_user.yml name their target explicitly and were adjusted accordingly, otherwise the role would no longer find the included task files. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
---
|
||||
|
||||
- name: Remove unix user
|
||||
ansible.builtin.include_tasks: remove_unix_user.yml
|
||||
with_dict: "{{ unix_users }}"
|
||||
loop_control:
|
||||
loop_var: unix_user
|
||||
when: unix_users is defined and
|
||||
unix_users | length > 0 and
|
||||
unix_user.value.state is defined and
|
||||
unix_user.value.state == 'absent'
|
||||
|
||||
- name: Remove unix groups
|
||||
ansible.builtin.include_tasks: remove_unix_group.yml
|
||||
with_dict: "{{ unix_groups }}"
|
||||
loop_control:
|
||||
loop_var: unix_group
|
||||
when: unix_groups is defined and
|
||||
unix_groups | length > 0 and
|
||||
unix_group.value.state is defined and
|
||||
unix_group.value.state == 'absent'
|
||||
|
||||
- name: Create unix groups
|
||||
ansible.builtin.include_tasks: create_unix_group.yml
|
||||
with_dict: "{{ unix_groups }}"
|
||||
loop_control:
|
||||
loop_var: unix_group
|
||||
when: unix_groups is defined and
|
||||
unix_groups | length > 0 and
|
||||
(
|
||||
(unix_group.value.state is defined and unix_group.value.state == 'present') or
|
||||
unix_group.value.state is not defined
|
||||
)
|
||||
|
||||
- name: Create unix users
|
||||
ansible.builtin.include_tasks: create_unix_user.yml
|
||||
no_log: true
|
||||
with_dict: "{{ unix_users }}"
|
||||
loop_control:
|
||||
loop_var: unix_user
|
||||
when: unix_users is defined and
|
||||
unix_users | length > 0 and
|
||||
(
|
||||
(unix_user.value.state is defined and unix_user.value.state == 'present') or
|
||||
unix_user.value.state is not defined
|
||||
)
|
||||
Reference in New Issue
Block a user