--- # Sorting is not enforeced - name: "Find KaaS templates" command: "echo {{ item | quote }}" register: results changed_when: false with_fileglob: - "{{ role_path }}/templates/{{ kaas_template_glob | default('*') }}.j2" - "{{ kaas_project_path }}/templates/{{ kaas_template_glob | default('*') }}.j2" - name: "Sort and execute KaaS templates" include: "template.yml" delegate_to: "{{ groups.masters[0] }}" run_once: true with_items: "{{ sorted_tmpl }}" vars: sorted_tmpl: "{{ results | json_query('results[*].stdout_lines') | sum(start=[]) | map('basename') | sort | unique }}" loop_control: loop_var: tmpl_name