diff options
author | Scott Dodson <sdodson@redhat.com> | 2018-02-08 19:37:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-08 19:37:51 -0500 |
commit | 0217c03b15bbf5ffcd5491f789de65ecb6e22ddd (patch) | |
tree | 5549242064eea4c041db77078095da24bfc90bca /roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | |
parent | 2936995d7d24a8c81b81d1d473fc48b6a374f2b4 (diff) | |
parent | 18f8c471157f60aeb0b2c64374dd9bede68320c4 (diff) | |
download | openshift-0217c03b15bbf5ffcd5491f789de65ecb6e22ddd.tar.gz openshift-0217c03b15bbf5ffcd5491f789de65ecb6e22ddd.tar.bz2 openshift-0217c03b15bbf5ffcd5491f789de65ecb6e22ddd.tar.xz openshift-0217c03b15bbf5ffcd5491f789de65ecb6e22ddd.zip |
Merge pull request #7068 from datarace/logging-fix
changed oc to {{ openshift_client_binary }}
Diffstat (limited to 'roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml')
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml index 879459cf6..14f2313e1 100644 --- a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml +++ b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml @@ -1,13 +1,13 @@ --- ## get all pods for the cluster - command: > - oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} + {{ openshift_client_binary }} get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods ### Check for cluster state before making changes -- if its red then we don't want to continue - name: "Checking current health for {{ _es_node }} cluster" shell: > - oc exec "{{ _cluster_pods.stdout.split(' ')[0] }}" -c elasticsearch -n "{{ openshift_logging_elasticsearch_namespace }}" -- es_cluster_health + {{ openshift_client_binary }} exec "{{ _cluster_pods.stdout.split(' ')[0] }}" -c elasticsearch -n "{{ openshift_logging_elasticsearch_namespace }}" -- es_cluster_health register: _pod_status when: _cluster_pods.stdout_lines | count > 0 @@ -46,7 +46,7 @@ - name: "Disable shard balancing for logging-{{ _cluster_component }} cluster" command: > - oc exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }' + {{ openshift_client_binary }} exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }' register: _disable_output changed_when: "'\"acknowledged\":true' in _disable_output.stdout" when: _cluster_pods.stdout_lines | count > 0 @@ -54,7 +54,7 @@ # Flush ES - name: "Flushing for logging-{{ _cluster_component }} cluster" command: > - oc exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_flush/synced' + {{ openshift_client_binary }} exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_flush/synced' register: _flush_output changed_when: "'\"acknowledged\":true' in _flush_output.stdout" when: @@ -62,7 +62,7 @@ - full_restart_cluster | bool - command: > - oc get dc -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + {{ openshift_client_binary }} get dc -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} register: _cluster_dcs ## restart all dcs for full restart @@ -86,12 +86,12 @@ ## 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[?(@.status.phase==\"Running\")].metadata.name} + {{ openshift_client_binary }} 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" command: > - oc exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "all" } }' + {{ openshift_client_binary }} exec {{ _cluster_pods.stdout.split(' ')[0] }} -c elasticsearch -n {{ openshift_logging_elasticsearch_namespace }} -- {{ __es_local_curl }} -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "all" } }' register: _enable_output changed_when: "'\"acknowledged\":true' in _enable_output.stdout" |