summaryrefslogtreecommitdiffstats
path: root/roles/openshift_resource/tasks/template.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_resource/tasks/template.yml')
-rw-r--r--roles/openshift_resource/tasks/template.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/roles/openshift_resource/tasks/template.yml b/roles/openshift_resource/tasks/template.yml
index f593544..b3838b5 100644
--- a/roles/openshift_resource/tasks/template.yml
+++ b/roles/openshift_resource/tasks/template.yml
@@ -12,14 +12,14 @@
command: "oc get -n {{project}} {{item.kind}}/{{item.name}}"
register: results
failed_when: false
- changed_when: (results | failed)
+ changed_when: results is failed
with_items: "{{ resources | default([]) }}"
- name: "{{ template }}: Detroy existing resources in {{project}}"
command: "oc delete -n {{project}} {{resources[item|int].kind}}/{{resources[item|int].name}}"
failed_when: false
with_sequence: start=0 count="{{resources | default([]) | length}}"
- when: ((recreate|default(false)) or (results | changed)) and (results.results[item|int].rc == 0)
+ when: ((recreate|default(false)) or (results is changed)) and (results.results[item|int].rc == 0)
# Replace often complains on various immutable variables it can't change. We ignore.
- name: "{{ template }}: Populate resources to {{project}} ({{ replace | default(false) | ternary('replace', 'create') }})"
@@ -27,14 +27,14 @@
register: status
failed_when: (status.rc != 0) and not (replace | default(false))
when:
- - (recreate | default(false)) or (replace | default(false)) or (results | changed)
+ - (recreate | default(false)) or (replace | default(false)) or (results is changed)
- resources | length > 0
# Replace will not create missing resources. We need to create here.
- name: "{{ template }}: Populate missing resources to {{project}} ({{ replace | default(false) | ternary('replace', 'create') }})"
shell: "oc process -n {{project}} -f '{{ template_path }}/{{template}}' {{ template_args | default('') }} | oc create -n {{project}} -f - {{ create_args | default('') }}"
when:
- - (replace | default(false)) and (results | changed)
+ - (replace | default(false)) and (results is changed)
- resources | length > 0