summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml
diff options
context:
space:
mode:
authordatarace <datarace101@gmail.com>2018-02-08 11:27:35 +0000
committerdatarace <datarace101@gmail.com>2018-02-08 11:27:35 +0000
commit18f8c471157f60aeb0b2c64374dd9bede68320c4 (patch)
tree8e0b8e3ef47f64b93d2173c9e43b658bfd7c8c84 /roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml
parent38f47effc1783b92328bcfc739b782a616786922 (diff)
downloadopenshift-18f8c471157f60aeb0b2c64374dd9bede68320c4.tar.gz
openshift-18f8c471157f60aeb0b2c64374dd9bede68320c4.tar.bz2
openshift-18f8c471157f60aeb0b2c64374dd9bede68320c4.tar.xz
openshift-18f8c471157f60aeb0b2c64374dd9bede68320c4.zip
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.yml14
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"