summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/templates.yml
blob: 75d43f34abc82a3a0c3569983e1469542cbd91f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
# 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