|
|
@ -1,6 +1,6 @@ |
|
|
|
--- |
|
|
|
- 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 cluster-health | grep -q 'cluster is healthy'" |
|
|
|
register: etcd_cluster_is_healthy |
|
|
|
failed_when: false |
|
|
|
changed_when: false |
|
|
@ -10,12 +10,14 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
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 cluster-health | grep -q 'cluster is healthy'" |
|
|
|
register: etcd_events_cluster_is_healthy |
|
|
|
failed_when: false |
|
|
|
changed_when: false |
|
|
@ -25,6 +27,8 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_events_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem" |
|
|
@ -70,7 +74,7 @@ |
|
|
|
when: is_etcd_master and etcd_events_cluster_setup |
|
|
|
|
|
|
|
- name: Configure | Wait for etcd cluster to be healthy |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_access_addresses }} cluster-health | grep -q 'cluster is healthy'" |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync cluster-health | grep -q 'cluster is healthy'" |
|
|
|
register: etcd_cluster_is_healthy |
|
|
|
until: etcd_cluster_is_healthy.rc == 0 |
|
|
|
retries: "{{ etcd_retries }}" |
|
|
@ -85,12 +89,14 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem" |
|
|
|
|
|
|
|
- name: Configure | Wait for etcd-events cluster to be healthy |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_events_access_addresses }} cluster-health | grep -q 'cluster is healthy'" |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync cluster-health | grep -q 'cluster is healthy'" |
|
|
|
register: etcd_events_cluster_is_healthy |
|
|
|
until: etcd_events_cluster_is_healthy.rc == 0 |
|
|
|
retries: "{{ etcd_retries }}" |
|
|
@ -105,12 +111,14 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_events_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem" |
|
|
|
|
|
|
|
- name: Configure | Check if member is in etcd cluster |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_access_addresses }} member list | grep -q {{ etcd_access_address }}" |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync member list | grep -q {{ etcd_access_address }}" |
|
|
|
register: etcd_member_in_cluster |
|
|
|
ignore_errors: true |
|
|
|
changed_when: false |
|
|
@ -119,12 +127,14 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem" |
|
|
|
|
|
|
|
- name: Configure | Check if member is in etcd-events cluster |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync --endpoints={{ etcd_events_access_addresses }} member list | grep -q {{ etcd_access_address }}" |
|
|
|
shell: "{{ bin_dir }}/etcdctl --no-sync member list | grep -q {{ etcd_access_address }}" |
|
|
|
register: etcd_events_member_in_cluster |
|
|
|
ignore_errors: true |
|
|
|
changed_when: false |
|
|
@ -133,6 +143,8 @@ |
|
|
|
tags: |
|
|
|
- facts |
|
|
|
environment: |
|
|
|
ETCDCTL_API: 2 |
|
|
|
ETCDCTL_ENDPOINTS: "{{ etcd_events_access_addresses }}" |
|
|
|
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem" |
|
|
|
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem" |
|
|
|
ETCDCTL_CA_FILE: "{{ etcd_cert_dir }}/ca.pem" |
|
|
|