---

- include: sudo_jessie.yml
  vars:
    user: "{{ item.value }}"
  loop: "{{ evolinux_users | dict2items }}"
  when:
    - evolinux_users | length > 0
    - user.create == evolinux_users_create
    - 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 == evolinux_users_create
  when:
    - ansible_distribution_major_version is defined
    - ansible_distribution_major_version is version('9', '>=')

- meta: flush_handlers
