diff options
author | Eric Wolinetz <ewolinet@redhat.com> | 2018-01-04 11:53:46 -0600 |
---|---|---|
committer | Eric Wolinetz <ewolinet@redhat.com> | 2018-01-05 08:45:23 -0600 |
commit | ceca2f9a8cbc11095c2fac20fcc789a61c424098 (patch) | |
tree | 77bb9b89771ecd1c1271cf62d5f156ec863232a4 /roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | |
parent | 72c57c0d9c49ad87b2d0b4b0eb9bec3a4f8d1d0c (diff) | |
download | openshift-ceca2f9a8cbc11095c2fac20fcc789a61c424098.tar.gz openshift-ceca2f9a8cbc11095c2fac20fcc789a61c424098.tar.bz2 openshift-ceca2f9a8cbc11095c2fac20fcc789a61c424098.tar.xz openshift-ceca2f9a8cbc11095c2fac20fcc789a61c424098.zip |
Adding logic to disable and reenable external communication to ES during full restart
Diffstat (limited to 'roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml')
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml index be43357b1..d55beec86 100644 --- a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml +++ b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml @@ -1,4 +1,22 @@ --- +# Disable external communication for {{ _cluster_component }} +- name: Disable external communication for logging-{{ _cluster_component }} + oc_service: + state: present + name: "logging-{{ _cluster_component }}" + namespace: "{{ openshift_logging_elasticsearch_namespace }}" + selector: + component: "{{ _cluster_component }}" + provider: openshift + connection: blocked + labels: + logging-infra: 'support' + ports: + - port: 9200 + targetPort: "restapi" + when: + - full_restart_cluster | bool + ## 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} @@ -54,3 +72,20 @@ 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" } }' register: _enable_output changed_when: "'\"acknowledged\":true' in _enable_output.stdout" + +# Reenable external communication for {{ _cluster_component }} +- name: Reenable external communication for logging-{{ _cluster_component }} + oc_service: + state: present + name: "logging-{{ _cluster_component }}" + namespace: "{{ openshift_logging_elasticsearch_namespace }}" + selector: + component: "{{ _cluster_component }}" + provider: openshift + labels: + logging-infra: 'support' + ports: + - port: 9200 + targetPort: "restapi" + when: + - full_restart_cluster | bool |