diff options
author | 2016-12-27 17:44:34 +0800 | |
---|---|---|
committer | 2017-01-05 09:42:35 +0800 | |
commit | 92f6ca7bb6d7b2f295406aab34094b1dba76ff94 (patch) | |
tree | c4e62927a3bf9862f7ba9ce286cbece2c4335ef4 /deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml | |
parent | 6072a49adb33f2bce3f48b9c7b8be7d96cf8501c (diff) |
Yamllint test
JIRA: COMPASS-516
Change-Id: I482ce9bc86f4f963258c5b8823e0b00e83556eef
Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml')
-rw-r--r-- | deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml index cfd778f1..77b18702 100644 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml +++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml @@ -13,10 +13,12 @@ - name: killall mysqld processes shell: sudo killall -9 mysqld when: RECOVERY_ENV - ignore_errors: True + ignore_errors: "True" - name: get cluster status - shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}' + shell: | + mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"' \ + | awk '{print $2}' register: cluster_status when: - inventory_hostname == haproxy_hosts.keys()[0] @@ -28,7 +30,9 @@ and not cluster_status.stdout | search("OPERATIONAL") - name: wait for cluster ready - shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}' + shell: | + mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"' \ + | awk '{print $2}' register: cluster_status until: cluster_status|success failed_when: not cluster_status.stdout | search("OPERATIONAL") @@ -39,7 +43,9 @@ and not cluster_status.stdout | search("OPERATIONAL") - name: if I in the cluster nodes - shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_incoming_addresses"'|awk '{print $2}' + shell: | + mysql --silent --skip-column-names \ + -e 'SHOW STATUS LIKE "wsrep_incoming_addresses"' | awk '{print $2}' register: cluster_nodes changed_when: false @@ -47,7 +53,7 @@ service: name: mysql state: restarted - enabled: yes + enabled: "yes" when: | inventory_hostname != haproxy_hosts.keys()[0] and not cluster_nodes.stdout | search( "{{ internal_ip }}") @@ -61,7 +67,5 @@ name: mysql state: restarted when: | - inventory_hostname == haproxy_hosts.keys()[0] + inventory_hostname == haproxy_hosts.keys()[0] and haproxy_hosts|length > 1 - - |