7c632352a0
The behaviour of the `include` module is badly defined (it try to choose between statically importing the tasks and dynamically including them) and can cause problems depending on any number of constraints (mostly if it choose the wrong behaviour). Replace it with the `import_tasks` (always statically import tasks) unless the `include` is in a loop in which case we replace it with `include_tasks` (always dynamically include tasks).
28 lines
671 B
YAML
28 lines
671 B
YAML
---
|
|
|
|
- include_tasks: 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:
|
|
- import_tasks: sudo_stretch_common.yml
|
|
|
|
- include_tasks: 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
|