aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2016-09-07 10:46:46 +0800
committerQiLiang <liangqi1@huawei.com>2016-09-07 12:57:47 +0800
commit297cd1ba745e4acc57cd31a80cd6c9bd68883c00 (patch)
tree6a4123a69fd2c1842f68ba941007d44928a524b3 /deploy/adapters/ansible
parent40752d2aa8796a72e55f9493beb3841f2bfbb43f (diff)
Restart mysql in centos-no-ha scenario
JIRA: COMPASS-482 Change-Id: Id26a0acbe9b725e236021a4b324960eef02b48eb Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
index b18ae8f7..780fc322 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
@@ -41,6 +41,24 @@
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