Fix quorum check when recovering broken etcd cluster (#8126)
This commit is contained in:
parent
331647f4ab
commit
9eacde212f
2 changed files with 4 additions and 2 deletions
|
@ -32,6 +32,9 @@
|
||||||
register: etcd_member_in_cluster
|
register: etcd_member_in_cluster
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
retries: "{{ etcd_retries }}"
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
until: etcd_member_in_cluster.rc == 0
|
||||||
tags:
|
tags:
|
||||||
- facts
|
- facts
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
when:
|
when:
|
||||||
- groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
|
|
||||||
# When there is an error, everything is printed in stderr_lines, even "is healthy" messages.
|
|
||||||
- name: Set has_quorum fact
|
- name: Set has_quorum fact
|
||||||
set_fact:
|
set_fact:
|
||||||
has_quorum: "{{ etcd_endpoint_health.stderr_lines | select('match', '.*is healthy.*') | list | length >= etcd_endpoint_health.stderr_lines | select('match', '.*is unhealthy.*') | list | length }}"
|
has_quorum: "{{ etcd_endpoint_health.stdout_lines | select('match', '.*is healthy.*') | list | length >= etcd_endpoint_health.stderr_lines | select('match', '.*is unhealthy.*') | list | length }}"
|
||||||
when:
|
when:
|
||||||
- groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue