Hi,
I thought the following should work, but I got a syntax error. Can the yml condition check syntax be used inside with_items? If not, how can I generate a dynamic list in the role to be used by with_items (register ??)? Thank you very much and appreciate any clues to fix following statement or workarounds.
- name: install scripts
copy: dest={{ home }}/scripts/{{ item }} src=scripts/{{ item }} mode=755
with_items:
{% set script_list = %}
{% for s in services %}
{% for g in s.groups %}
{% if g in groups %}
{% if script_list.append(s.script) %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% for script in script_list | unique %}
{{ script }}
{% endif %}