2016-05-27 17:55:52 +08:00
|
|
|
---
|
2018-03-01 16:39:14 +08:00
|
|
|
- name: Configure | Check if etcd cluster is healthy
|
2017-11-14 19:28:35 +08:00
|
|
|
shell: "{{ bin_dir }}/etcdctl --endpoints={{ etcd_access_addresses }} cluster-health | grep -q 'cluster is healthy'"
|
2016-05-27 17:55:52 +08:00
|
|
|
register: etcd_cluster_is_healthy
|
2017-06-30 02:13:02 +08:00
|
|
|
ignore_errors: true
|
2016-05-27 17:55:52 +08:00
|
|
|
changed_when: false
|
2017-02-07 02:13:21 +08:00
|
|
|
check_mode: no
|
2016-05-27 17:55:52 +08:00
|
|
|
when: is_etcd_master
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
2017-11-07 22:06:16 +08:00
|
|
|
environment:
|
2018-04-01 02:06:09 +08:00
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem"
|
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|
2018-03-01 16:39:14 +08:00
|
|
|
|
|
|
|
- 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'"
|
|
|
|
register: etcd_events_cluster_is_healthy
|
|
|
|
ignore_errors: true
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
|
|
|
when: is_etcd_master and etcd_events_cluster_setup
|
|
|
|
tags:
|
|
|
|
- facts
|
|
|
|
environment:
|
2018-04-01 02:06:09 +08:00
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem"
|
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|