ansible-role-unix-users/tasks/create_unix_group.yml
2023-02-08 18:25:07 +01:00

15 lines
581 B
YAML

---
- name: Create unix group {{ unix_group.key }} with random gid
group:
name: "{{ unix_group.key }}"
state: "{{ unix_group.value.state | default('present') }}"
when: unix_group.value.gid is not defined or unix_group.value.gid is defined and unix_group.value.gid | length <= 0
- name: Create unix group {{ unix_group.key }} with pre-defined gid
group:
name: "{{ unix_group.key }}"
gid: "{{ unix_group.value.gid }}"
state: "{{ unix_group.value.state | default('present') }}"
when: unix_group.value.gid is defined and unix_group.value.gid | length > 0