ansible-roles/evolinux-users/tasks/main.yml
Patrick Marchand 2c1ec040d1 Simplify user subset creation
Instead of tags, allow only one subset of users to be created at a time.
2022-08-24 09:05:29 -04:00

29 lines
673 B
YAML

---
- name: "System compatibility checks"
assert:
that:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version('8', '>=')
msg: only compatible with Debian >= 8
- debug:
msg: "Warning: empty 'evolinux_users' variable, tasks will be skipped!"
when: evolinux_users | length == 0
- name: Create user accounts
include: user.yml
vars:
user: "{{ item.value }}"
loop: "{{ evolinux_users | dict2items }}"
when:
- user.create == evolinux_users_create
- evolinux_users | length > 0
- name: Configure sudo
include: sudo.yml
- name: Configure SSH
include: ssh.yml
when: evolinux_users | length > 0