summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/template.yml
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-18 22:59:31 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-18 22:59:31 +0100
commit47f350bc3aa85a8bd406d95faf084df2abf74ae9 (patch)
tree72ad1e91bac46d3457f89781dc90f0d6c1c074d5 /roles/ands_kaas/tasks/template.yml
parent006f333828db373435daa15483d2ab753048f62a (diff)
downloadands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.gz
ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.bz2
ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.xz
ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.zip
Second revision: includes hostpath mounts, gluster block storage, kaas apps, etc.
Diffstat (limited to 'roles/ands_kaas/tasks/template.yml')
-rw-r--r--roles/ands_kaas/tasks/template.yml9
1 files changed, 8 insertions, 1 deletions
diff --git a/roles/ands_kaas/tasks/template.yml b/roles/ands_kaas/tasks/template.yml
index 6c90b3d..418331a 100644
--- a/roles/ands_kaas/tasks/template.yml
+++ b/roles/ands_kaas/tasks/template.yml
@@ -1,6 +1,9 @@
- name: "Populate template {{ tmpl_name }}"
- template: src="{{ item }}" dest="{{ kaas_template_path }}/{{ item | basename | regex_replace('\.j2','') }}" owner=root group=root mode="0644"
+ 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/"
@@ -10,8 +13,12 @@
- 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