Skip to content

Commit 7750528

Browse files
committed
Revert "Avoid risky pipes. Increase retires to handle clusters with single frozen or cold datanode"
This reverts commit d83d38f.
1 parent 1234f91 commit 7750528

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

roles/elasticsearch/tasks/elasticsearch-rolling-start.yml

+14-12
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,23 @@
3636
port: "{{ elasticstack_elasticsearch_http_port }}"
3737
delay: 30
3838

39-
- name: Confirm the node joins the cluster
40-
ansible.builtin.uri:
41-
url: "{{ elasticsearch_http_protocol }}://{{ elasticsearch_api_host }}:{{ elasticstack_elasticsearch_http_port }}/_cat/nodes?h=name&format=json"
42-
method: GET
43-
user: elastic
44-
password: "{{ elasticstack_password.stdout }}"
45-
validate_certs: no
46-
register: response
47-
until: node_found | bool
39+
- name: Confirm the node joins the cluster # noqa: risky-shell-pipe
40+
ansible.builtin.shell: >
41+
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
42+
curl
43+
-k
44+
-u elastic:{{ elasticstack_password.stdout }}
45+
-s
46+
-m 2
47+
'{{ elasticsearch_http_protocol }}://{{ elasticsearch_api_host }}:{{ elasticstack_elasticsearch_http_port }}/_cat/nodes?h=name'
48+
| grep
49+
-E
50+
'^{{ elasticsearch_nodename }}$'
51+
register: result
52+
until: result.rc == 0
4853
retries: 200
4954
delay: 3
5055
changed_when: false
51-
vars:
52-
node_found: "{{ response.json | json_query(node_query) | length > 0 }}"
53-
node_query: "[?name=='{{ elasticsearch_nodename }}']"
5456

5557
# Don't continue the play unless cluster health is OK
5658
- name: Cluster health check

0 commit comments

Comments
 (0)