summaryrefslogtreecommitdiffstats
path: root/roles/openshift_resource
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-23 02:16:43 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-23 02:16:43 +0100
commitca5b5b005d2ca454015f8b0faa54372c60a0e40a (patch)
treee3dda23e189f4e15be0967ba83a31980dcd2d44d /roles/openshift_resource
parente4751f88e52aa8e89e4c94bc6fe4c3346eccf6fe (diff)
downloadands-ca5b5b005d2ca454015f8b0faa54372c60a0e40a.tar.gz
ands-ca5b5b005d2ca454015f8b0faa54372c60a0e40a.tar.bz2
ands-ca5b5b005d2ca454015f8b0faa54372c60a0e40a.tar.xz
ands-ca5b5b005d2ca454015f8b0faa54372c60a0e40a.zip
GlusterFS subpaths, ADEI frontend pods, fixes
Diffstat (limited to 'roles/openshift_resource')
-rw-r--r--roles/openshift_resource/tasks/main.yml4
-rw-r--r--roles/openshift_resource/tasks/resource.yml8
2 files changed, 7 insertions, 5 deletions
diff --git a/roles/openshift_resource/tasks/main.yml b/roles/openshift_resource/tasks/main.yml
index d44d2e0..af071f9 100644
--- a/roles/openshift_resource/tasks/main.yml
+++ b/roles/openshift_resource/tasks/main.yml
@@ -14,9 +14,9 @@
when: template.find(".json") == -1
- include_tasks: template.yml
- when: tmpl.kind == "Template"
+ when: (tmpl.kind == "Template") and (tmpl.parameters is not defined)
- include_tasks: resource.yml
- when: tmpl.kind != "Template"
+ when: (tmpl.parameters is defined) or (tmpl.kind != "Template")
run_once: true
diff --git a/roles/openshift_resource/tasks/resource.yml b/roles/openshift_resource/tasks/resource.yml
index 326abbb..769a89c 100644
--- a/roles/openshift_resource/tasks/resource.yml
+++ b/roles/openshift_resource/tasks/resource.yml
@@ -5,16 +5,18 @@
- name: Lookup the specified resource
command: "oc get -n {{project}} {{rkind}}/{{rname}}"
- register: result
+ register: find_result
+ changed_when: false
failed_when: false
- changed_when: (result | failed)
- name: Detroy existing resources
command: "oc delete -n {{project}} {{rkind}}/{{rname}}"
+ register: rm_result
failed_when: false
+ changed_when: (rm_result | succeeded)
when: (recreate|default(false))
- name: Create resources defined in template
command: "oc create -n {{project}} -f '{{ template_path }}/{{ template }}' {{ create_args | default('') }}"
- when: (recreate|default(false)) or (result | changed)
+ when: (recreate|default(false)) or (find_result.rc != 0)
run_once: true