ansible-role-openstack-oper.../tasks/validate_galera.yml

20 lines
753 B
YAML

- name: Get the database clustercheck password
script: |
/bin/hiera -c /etc/puppet/hiera.yaml mysql_clustercheck_password
when: mysql_clustercheck_password is undefined
register: mysql_clustercheck_password_cmd_output
become: 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
- name: Check the Galera cluster is Synced
script: |
/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