Allow etcd member join by checking cluster health only on first etcd (#5032)
Change-Id: I9cc01cef3a437893225e2d9f58495826bbce7be9
This commit is contained in:
parent
0d0b1fdf82
commit
7abf6a6958
1 changed files with 13 additions and 4 deletions
|
@ -64,7 +64,7 @@
|
|||
when: is_etcd_master and etcd_events_cluster_setup
|
||||
|
||||
- name: Configure | Check if etcd cluster is healthy
|
||||
shell: "{{ bin_dir }}/etcdctl --endpoints={{ etcd_access_addresses }} cluster-health | grep -q 'cluster is healthy'"
|
||||
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_client_url }} cluster-health | grep -q 'cluster is healthy'"
|
||||
register: etcd_cluster_is_healthy
|
||||
until: etcd_cluster_is_healthy.rc == 0
|
||||
retries: 4
|
||||
|
@ -72,7 +72,11 @@
|
|||
ignore_errors: false
|
||||
changed_when: false
|
||||
check_mode: no
|
||||
when: is_etcd_master and etcd_cluster_setup
|
||||
delegate_to: "{{ groups['etcd'][0] }}"
|
||||
run_once: yes
|
||||
when:
|
||||
- is_etcd_master
|
||||
- etcd_cluster_setup
|
||||
tags:
|
||||
- facts
|
||||
environment:
|
||||
|
@ -81,7 +85,7 @@
|
|||
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem"
|
||||
|
||||
- name: Configure | Check if etcd-events cluster is healthy
|
||||
shell: "{{ bin_dir }}/etcdctl --endpoints={{ etcd_events_access_addresses }} cluster-health | grep -q 'cluster is healthy'"
|
||||
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_events_client_url }} cluster-health | grep -q 'cluster is healthy'"
|
||||
register: etcd_events_cluster_is_healthy
|
||||
until: etcd_events_cluster_is_healthy.rc == 0
|
||||
retries: 4
|
||||
|
@ -89,7 +93,12 @@
|
|||
ignore_errors: false
|
||||
changed_when: false
|
||||
check_mode: no
|
||||
when: is_etcd_master and etcd_events_cluster_setup
|
||||
delegate_to: "{{ groups['etcd'][0] }}"
|
||||
run_once: yes
|
||||
when:
|
||||
- is_etcd_master
|
||||
- etcd_events_cluster_setup
|
||||
- etcd_cluster_setup
|
||||
tags:
|
||||
- facts
|
||||
environment:
|
||||
|
|
Loading…
Reference in a new issue