ansible-roles/evolinux-users/tasks/sudo.yml
Patrick Marchand 9dfcfe1ef3
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
Made it possible to only create a subset of users
The evolinux_users_create variable is a list of tags that defaults to ['active'].
Only the users that have one of the tags in the evolinux_users_create list will be created.
2022-08-23 20:18:45 -04:00

28 lines
700 B
YAML

---
- include: sudo_jessie.yml
vars:
user: "{{ item.value }}"
loop: "{{ evolinux_users | dict2items }}"
when:
- evolinux_users | length > 0
- user.create | intersect(evolinux_users_create) | length > 0
- ansible_distribution_release == "jessie"
- block:
- include: sudo_stretch_common.yml
- include: sudo_stretch_user.yml
vars:
user: "{{ item.value }}"
loop: "{{ evolinux_users | dict2items }}"
when:
- evolinux_users | length > 0
- user.create | intersect(evolinux_users_create) | length > 0
when:
- ansible_distribution_major_version is defined
- ansible_distribution_major_version is version('9', '>=')
- meta: flush_handlers