From cba41110aa086553192ed5a309a6b8031812c221 Mon Sep 17 00:00:00 2001
From: "Suren A. Chilingaryan" <csa@suren.me>
Date: Thu, 22 Mar 2018 05:22:13 +0100
Subject: Fix creating empty templates

---
 roles/openshift_resource/tasks/main.yml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'roles/openshift_resource')

diff --git a/roles/openshift_resource/tasks/main.yml b/roles/openshift_resource/tasks/main.yml
index 8606aa3..086ab2b 100644
--- a/roles/openshift_resource/tasks/main.yml
+++ b/roles/openshift_resource/tasks/main.yml
@@ -23,9 +23,15 @@
     when: 
       - tmpl.kind == "Template"
       - strategy == "auto"
-    
+
+# With results it populates empty templates....    
   - name: "Creating template/resources defined in {{ template }}"
     include_tasks: resource.yml
-    when: results | skipped
- 
+    vars:
+      metadata:    "{{ tmpl.metadata | default({}) }}"
+      annotations: "{{ metadata.annotations | default({}) }}"
+      strategy:    "{{ annotations['kaas/strategy'] | default('auto') }}"
+    when: (tmpl.kind != "Template") or (strategy != "auto")
+#    when: results | skipped
+
   run_once: true
-- 
cgit v1.2.3