Restart mysql in centos-no-ha scenario 07/20507/2
authorQiLiang <liangqi1@huawei.com>
Wed, 7 Sep 2016 02:46:46 +0000 (10:46 +0800)
committerQiLiang <liangqi1@huawei.com>
Wed, 7 Sep 2016 04:57:47 +0000 (12:57 +0800)
JIRA: COMPASS-482

Change-Id: Id26a0acbe9b725e236021a4b324960eef02b48eb
Signed-off-by: QiLiang <liangqi1@huawei.com>
deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml

index b18ae8f..780fc32 100644 (file)
   script: remove_user.sh
   when: ansible_os_family == "RedHat"
 
+- name: restart mysql for centos noha
+  service:
+    name: mysql
+    state: restarted
+  when: >
+    inventory_hostname == haproxy_hosts.keys()[0]
+    and haproxy_hosts|length == 1
+    and ansible_os_family == "RedHat"
+
+- name: restart mysql second time for centos noha
+  service:
+    name: mysql
+    state: restarted
+  when: >
+    inventory_hostname == haproxy_hosts.keys()[0]
+    and haproxy_hosts|length == 1
+    and ansible_os_family == "RedHat"
+
 - name: restart first nodes
   service:
     name: mysql