From 79e60f2f201e1330a2716825dac985abb7a2bef0 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 28 Aug 2019 23:24:34 +0200 Subject: Create application template if instantination is disabeld --- roles/ands_kaas/tasks/do_app.yml | 4 ++-- roles/ands_kaas/tasks/do_apps.yml | 2 +- roles/ands_kaas/tasks/template.yml | 1 - roles/openshift_resource/tasks/main.yml | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'roles') diff --git a/roles/ands_kaas/tasks/do_app.yml b/roles/ands_kaas/tasks/do_app.yml index 556a421..c653b6d 100644 --- a/roles/ands_kaas/tasks/do_app.yml +++ b/roles/ands_kaas/tasks/do_app.yml @@ -3,11 +3,11 @@ run_once: true vars: tmpl_name: "40-kaas-app-builders.yml.j2" - yml_name: ternary ( '80-' + (appname | default('kaas')) + '-builder.yml' + yml_name: "{{ '80-' + (appname | default('kaas')) + '-builder.yml' }}" - name: "Process KaaS App pods" include_tasks: "template.yml" run_once: true vars: tmpl_name: "50-kaas-app-pods.yml.j2" - yml_name: ternary ( '90-' + (appname | default('kaas')) + '.yml' + yml_name: "{{ '90-' + (appname | default('kaas')) + '.yml' }}" diff --git a/roles/ands_kaas/tasks/do_apps.yml b/roles/ands_kaas/tasks/do_apps.yml index 382eb3c..ffcecfe 100644 --- a/roles/ands_kaas/tasks/do_apps.yml +++ b/roles/ands_kaas/tasks/do_apps.yml @@ -1,5 +1,5 @@ - name: "Process KaaS apps" - include_tasks: "app.yml" + include_tasks: "do_app.yml" run_once: true with_dict: "{{ kaas_project_apps | default({}) }}" loop_control: diff --git a/roles/ands_kaas/tasks/template.yml b/roles/ands_kaas/tasks/template.yml index 73cf1c4..a12b192 100644 --- a/roles/ands_kaas/tasks/template.yml +++ b/roles/ands_kaas/tasks/template.yml @@ -13,7 +13,6 @@ - name: "Configure KaaS resources defined in {{ tmpl_name }}" include_role: name="openshift_resource" - when: instantiate == true vars: default_name: "{{ tmpl_name | basename | regex_replace('\\.j2','') }}" dest_name: "{{ yml_name | default(default_name) }}" diff --git a/roles/openshift_resource/tasks/main.yml b/roles/openshift_resource/tasks/main.yml index 086ab2b..5dcc894 100644 --- a/roles/openshift_resource/tasks/main.yml +++ b/roles/openshift_resource/tasks/main.yml @@ -19,7 +19,7 @@ vars: metadata: "{{ tmpl.metadata | default({}) }}" annotations: "{{ metadata.annotations | default({}) }}" - strategy: "{{ annotations['kaas/strategy'] | default('auto') }}" + strategy: "{{ instantiate | default(true) | ternary (annotations['kaas/strategy'] | default('auto'), 'manual') }}" when: - tmpl.kind == "Template" - strategy == "auto" @@ -30,7 +30,7 @@ vars: metadata: "{{ tmpl.metadata | default({}) }}" annotations: "{{ metadata.annotations | default({}) }}" - strategy: "{{ annotations['kaas/strategy'] | default('auto') }}" + strategy: "{{ instantiate | default(true) | ternary (annotations['kaas/strategy'] | default('auto'), 'manual') }}" when: (tmpl.kind != "Template") or (strategy != "auto") # when: results | skipped -- cgit v1.2.3