Fix broken playbooks

Turns out that assert cannot be used in a task list.  Changed the use of
assert to the fail module.

Change-Id: If9665a9bd21645d48d0ae67bd6118da88a8b1c93
This commit is contained in:
Julia Kreger 2014-08-26 16:08:35 -04:00
parent d6cc9e1c6f
commit 770d76f171
2 changed files with 8 additions and 7 deletions

View File

@ -1,8 +1,8 @@
- name: Fetch Galera sync status from MySQL
sudo: yes # Necessary since root is granted access
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 == 4 }}"
when: wsrep_local_state == "4"
- set_fact: galera_status="Out of Sync"
when: "{{ wsrep_local_state != 4 }}"
when: wsrep_local_state != "4"

View File

@ -70,16 +70,17 @@
sudo: yes
tasks:
- include: galera_status.yml
- assert:
that: galera_status == 'Synced'
- service: name=mysql enabled=no state=stopped
when: galera_status == 'Synced'
- fail: msg="Galera Replication is out of sync - cannot safely proceed"
when: galera_status != 'Synced'
- hosts: controllermgmt
name: Stop MySQL on Overcloud Controller Mgmt node
sudo: yes
tasks:
- include: galera_status.yml
- assert:
that: galera_status == 'Out of Sync'
- fail: msg="Galera Replication is out of sync - cannot safely proceed"
when: galera_status == 'Out of Sync'
- service: name=mysql enabled=no state=stopped
- hosts: undercloud
name: Rebuild and Refresh Undercloud