diff options
author | Eric Wolinetz <ewolinet@redhat.com> | 2018-01-16 10:45:39 -0600 |
---|---|---|
committer | Eric Wolinetz <ewolinet@redhat.com> | 2018-01-16 10:45:39 -0600 |
commit | 4d96cbb81d758af87da6ef547aa655afcbc9995d (patch) | |
tree | b59da81080cb1678add425030c671f4982b5689f /roles/openshift_logging_elasticsearch | |
parent | 0d59a0868971e7f038b775adef024a8f324ab010 (diff) | |
download | openshift-4d96cbb81d758af87da6ef547aa655afcbc9995d.tar.gz openshift-4d96cbb81d758af87da6ef547aa655afcbc9995d.tar.bz2 openshift-4d96cbb81d758af87da6ef547aa655afcbc9995d.tar.xz openshift-4d96cbb81d758af87da6ef547aa655afcbc9995d.zip |
Ensure we are running oc execs against running pods
Diffstat (limited to 'roles/openshift_logging_elasticsearch')
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/get_es_version.yml | 4 | ||||
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml b/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml index 9182bddb2..16de6f252 100644 --- a/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml +++ b/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml @@ -1,6 +1,6 @@ --- - command: > - oc get pod -l component=es,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component=es,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Getting ES version for logging-es cluster" @@ -10,7 +10,7 @@ when: _cluster_pods.stdout_lines | count > 0 - command: > - oc get pod -l component=es-ops,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component=es-ops,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _ops_cluster_pods - name: "Getting ES version for logging-es-ops cluster" diff --git a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml index d55beec86..6bce13d1d 100644 --- a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml +++ b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml @@ -19,7 +19,7 @@ ## get all pods for the cluster - command: > - oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Disable shard balancing for logging-{{ _cluster_component }} cluster" @@ -64,7 +64,7 @@ ## we may need a new first pod to run against -- fetch them all again - command: > - oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Enable shard balancing for logging-{{ _cluster_component }} cluster" |