diff options
author | ewolinetz <ewolinet@redhat.com> | 2017-01-13 17:03:32 -0600 |
---|---|---|
committer | ewolinetz <ewolinet@redhat.com> | 2017-01-13 17:03:32 -0600 |
commit | 427d4c235c58196f5745184c9d0b3e6bc2a92618 (patch) | |
tree | 22056856be588c885da801d69955878b9fe31eff /roles/openshift_logging/tasks | |
parent | 9cf70bb6991df874350ea0f5c97da26bb6757edb (diff) | |
download | openshift-427d4c235c58196f5745184c9d0b3e6bc2a92618.tar.gz openshift-427d4c235c58196f5745184c9d0b3e6bc2a92618.tar.bz2 openshift-427d4c235c58196f5745184c9d0b3e6bc2a92618.tar.xz openshift-427d4c235c58196f5745184c9d0b3e6bc2a92618.zip |
delete idempotent
Diffstat (limited to 'roles/openshift_logging/tasks')
-rw-r--r-- | roles/openshift_logging/tasks/delete_logging.yaml | 21 | ||||
-rw-r--r-- | roles/openshift_logging/tasks/label_node.yaml | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/roles/openshift_logging/tasks/delete_logging.yaml b/roles/openshift_logging/tasks/delete_logging.yaml index 6e8fc29d0..908f3ee88 100644 --- a/roles/openshift_logging/tasks/delete_logging.yaml +++ b/roles/openshift_logging/tasks/delete_logging.yaml @@ -14,17 +14,24 @@ - routes - templates - daemonset + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 + # delete the oauthclient - name: delete oauthclient kibana-proxy command: > {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig delete oauthclient kibana-proxy --ignore-not-found=true + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete any image streams that we may have created - name: delete logging is command: > {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig delete is -l logging-infra=support -n {{ openshift_logging_namespace }} --ignore-not-found=true + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete our old secrets - name: delete logging secrets @@ -38,6 +45,8 @@ - logging-kibana-proxy - logging-curator ignore_errors: yes + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete role bindings - name: delete rolebindings @@ -46,6 +55,8 @@ delete rolebinding {{ item }} -n {{ openshift_logging_namespace }} --ignore-not-found=true with_items: - logging-elasticsearch-view-role + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete cluster role bindings - name: delete cluster role bindings @@ -54,6 +65,8 @@ delete clusterrolebindings {{ item }} -n {{ openshift_logging_namespace }} --ignore-not-found=true with_items: - rolebinding-reader + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete cluster roles - name: delete cluster roles @@ -62,6 +75,8 @@ delete clusterroles {{ item }} -n {{ openshift_logging_namespace }} --ignore-not-found=true with_items: - rolebinding-reader + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete our service accounts - name: delete service accounts @@ -73,6 +88,8 @@ - aggregated-logging-kibana - aggregated-logging-curator - aggregated-logging-fluentd + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete our roles - name: delete roles @@ -81,6 +98,8 @@ delete clusterrole {{ item }} -n {{ openshift_logging_namespace }} --ignore-not-found=true with_items: - daemonset-admin + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 # delete our configmaps - name: delete configmaps @@ -91,3 +110,5 @@ - logging-curator - logging-elasticsearch - logging-fluentd + register: delete_result + changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0 diff --git a/roles/openshift_logging/tasks/label_node.yaml b/roles/openshift_logging/tasks/label_node.yaml index 6a97fece2..aecb5d81b 100644 --- a/roles/openshift_logging/tasks/label_node.yaml +++ b/roles/openshift_logging/tasks/label_node.yaml @@ -26,3 +26,4 @@ - unlabel is defined - unlabel - not ansible_check_mode + - label_value.stdout != "" |