2022-05-09 08:17:07 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Remove unix user
|
2023-02-12 14:08:40 +00:00
|
|
|
ansible.builtin.include_tasks: remove_unix_user.yml
|
2022-05-09 08:17:07 +00:00
|
|
|
with_dict: "{{ unix_users }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: unix_user
|
2022-05-09 09:33:04 +00:00
|
|
|
when: unix_users is defined and
|
|
|
|
unix_users | length > 0 and
|
2022-05-09 09:02:35 +00:00
|
|
|
unix_user.value.state is defined and
|
|
|
|
unix_user.value.state == 'absent'
|
2022-05-09 08:17:07 +00:00
|
|
|
|
2022-07-19 15:54:56 +00:00
|
|
|
- name: Remove unix groups
|
2023-02-12 14:08:40 +00:00
|
|
|
ansible.builtin.include_tasks: remove_unix_group.yml
|
2022-07-19 15:54:56 +00:00
|
|
|
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'
|
|
|
|
|
2022-05-09 08:17:07 +00:00
|
|
|
- name: Create unix groups
|
2023-02-12 14:08:40 +00:00
|
|
|
ansible.builtin.include_tasks: create_unix_group.yml
|
2022-05-09 08:17:07 +00:00
|
|
|
with_dict: "{{ unix_groups }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: unix_group
|
2022-05-09 09:02:35 +00:00
|
|
|
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
|
|
|
|
)
|
2022-05-09 08:17:07 +00:00
|
|
|
|
|
|
|
- name: Create unix users
|
2023-02-12 14:08:40 +00:00
|
|
|
ansible.builtin.include_tasks: create_unix_user.yml
|
2023-02-15 13:25:49 +00:00
|
|
|
no_log: true
|
2022-05-09 08:17:07 +00:00
|
|
|
with_dict: "{{ unix_users }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: unix_user
|
2022-05-09 09:33:04 +00:00
|
|
|
when: unix_users is defined and
|
|
|
|
unix_users | length > 0 and
|
2022-05-09 09:02:35 +00:00
|
|
|
(
|
|
|
|
(unix_user.value.state is defined and unix_user.value.state == 'present') or
|
|
|
|
unix_user.value.state is not defined
|
|
|
|
)
|