23 lines
798 B
YAML
23 lines
798 B
YAML
- name: Get the database clustercheck password
|
|
shell: |
|
|
/bin/hiera -c /etc/puppet/hiera.yaml mysql_clustercheck_password
|
|
when: mysql_clustercheck_password is undefined
|
|
register: mysql_clustercheck_password_cmd_output
|
|
become: true
|
|
no_log: true
|
|
|
|
- name: Convert the database clustercheck password if unknown
|
|
set_fact:
|
|
mysql_clustercheck_password: "{{ mysql_clustercheck_password_cmd_output.stdout_lines[0] }}"
|
|
when: mysql_clustercheck_password is undefined
|
|
no_log: true
|
|
|
|
- name: Check the Galera cluster is Synced
|
|
command: |
|
|
/bin/mysql -u clustercheck -p{{ mysql_clustercheck_password }} -nNE -e "SHOW STATUS LIKE 'wsrep_local_state';" | tail -1
|
|
register: clustercheck_state
|
|
until: clustercheck_state.stdout | trim | int == 4
|
|
retries: 10
|
|
delay: 5
|
|
no_log: true
|