summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/template.yml
blob: 418331a212e02551639433ad0048308ace6372e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- name: "Populate template {{ tmpl_name }}"
  template: src="{{ item }}" dest="{{ kaas_template_path }}/{{ dest_name }}" owner=root group=root mode="0644"
  register: result
  vars:
    default_name: "{{ item | basename | regex_replace('\\.j2','') }}"
    dest_name: "{{ (name is defined) | ternary ( (name | default('')) + '.yml', default_name ) }}"
  with_first_found:
    - paths:
        - "{{ role_path }}/templates/"
        - "{{ kaas_project_path }}/templates/"
      files:
        - "{{ tmpl_name }}"

- name: "Configure KaaS resources defined in {{ tmpl_name }}"
  include_role: name="openshift_resource"
  when: instantiate == true
  vars: 
    template: "{{ tmpl_name | basename | regex_replace('\\.j2','') }}"
    template_path: "{{ kaas_template_path }}"
    project: "{{ kaas_project }}"
    recreate: "{{ result | changed | ternary (true, false) }}"

# alternatively load template
# TODO