---

- 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
