- service: name=mysql state=started
- name: Fetch Galera sync status from MySQL
  sudo: yes
  command: mysql -N -e "SHOW STATUS LIKE 'wsrep_local_state'"
  register: wsrep_local_state
- set_fact: galera_status="Synced"
  when: wsrep_local_state.stdout == "wsrep_local_state\t4"
- set_fact: galera_status="Out of Sync"
  when: wsrep_local_state.stdout != "wsrep_local_state\t4"

- service: name=mysql state=started
- name: Fetch Galera sync status from MySQL
  sudo: yes
  command: mysql --defaults-file=/mnt/state/root/metadata.my.cnf -N -e "SHOW STATUS LIKE 'wsrep_local_state'"
  register: wsrep_local_state
- set_fact: galera_status="Synced"
  when: wsrep_local_state.stdout == "wsrep_local_state\t4"
- set_fact: galera_status="Out of Sync"
  when: wsrep_local_state.stdout != "wsrep_local_state\t4"

Use defaults file explicitly for galera status
Use defaults file explicitly for galera status

There are corner cases while recovering from errors where this file will be
available but the resulting .my.cnf will not be installed into root's home
directory yet. This makes the process more resilient.

Change-Id: I2e9bf921ddaba82a9c40a8df44b05fe7dee92fb6
