summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging
diff options
context:
space:
mode:
authorewolinetz <ewolinet@redhat.com>2017-02-01 10:38:29 -0600
committerewolinetz <ewolinet@redhat.com>2017-02-01 11:09:38 -0600
commit64423cc6a7772b4ba894f05b5c18de3a0895570d (patch)
treec849b27d31e1c41dbd8b23155b72e1b3efec422f /roles/openshift_logging
parentfca1c828306729a4a248603c26ecd58743a50601 (diff)
downloadopenshift-64423cc6a7772b4ba894f05b5c18de3a0895570d.tar.gz
openshift-64423cc6a7772b4ba894f05b5c18de3a0895570d.tar.bz2
openshift-64423cc6a7772b4ba894f05b5c18de3a0895570d.tar.xz
openshift-64423cc6a7772b4ba894f05b5c18de3a0895570d.zip
Updating oc_apply changed_when conditions, fixing filter usage for openshift_hosted_logging playbook
Diffstat (limited to 'roles/openshift_logging')
-rw-r--r--roles/openshift_logging/tasks/oc_apply.yaml27
1 files changed, 14 insertions, 13 deletions
diff --git a/roles/openshift_logging/tasks/oc_apply.yaml b/roles/openshift_logging/tasks/oc_apply.yaml
index 2dc0b0d74..5897910ee 100644
--- a/roles/openshift_logging/tasks/oc_apply.yaml
+++ b/roles/openshift_logging/tasks/oc_apply.yaml
@@ -18,6 +18,17 @@
failed_when: "'error' in generation_apply.stderr"
changed_when: no
+- name: Determine change status of {{file_content.kind}} {{file_content.metadata.name}}
+ shell: >
+ {{ openshift.common.client_binary }} --config={{ kubeconfig }}
+ get {{file_content.kind}} {{file_content.metadata.name}}
+ -o jsonpath='{.metadata.resourceVersion}'
+ -n {{namespace}} || echo 0
+ register: generation_changed
+ changed_when: generation_changed.stdout | int > generation_init.stdout | int
+ when:
+ - "'field is immutable' not in generation_apply.stderr"
+
- name: Removing previous {{file_name}}
command: >
{{ openshift.common.client_binary }} --config={{ kubeconfig }}
@@ -25,25 +36,15 @@
-n {{ namespace }}
register: generation_delete
failed_when: "'error' in generation_delete.stderr"
- changed_when: no
+ changed_when: generation_delete.rc == 0
when: "'field is immutable' in generation_apply.stderr"
-- name: Applying {{file_name}}
+- name: Recreating {{file_name}}
command: >
{{ openshift.common.client_binary }} --config={{ kubeconfig }}
apply -f {{ file_name }}
-n {{ namespace }}
register: generation_apply
failed_when: "'error' in generation_apply.stderr"
- changed_when: no
+ changed_when: generation_apply.rc == 0
when: "'field is immutable' in generation_apply.stderr"
-
-- name: Determine change status of {{file_content.kind}} {{file_content.metadata.name}}
- shell: >
- {{ openshift.common.client_binary }} --config={{ kubeconfig }}
- get {{file_content.kind}} {{file_content.metadata.name}}
- -o jsonpath='{.metadata.resourceVersion}'
- -n {{namespace}} || echo 0
- register: generation_changed
- failed_when: "'error' in generation_changed.stderr"
- changed_when: generation_changed.stdout | int > generation_init.stdout | int