From 11f6bd1154b5ad29aab7382feb28868dfbf9a88f Mon Sep 17 00:00:00 2001 From: QiLiang Date: Wed, 7 Sep 2016 10:46:46 +0800 Subject: Restart mysql in centos-no-ha scenario JIRA: COMPASS-482 Change-Id: Id26a0acbe9b725e236021a4b324960eef02b48eb Signed-off-by: QiLiang --- .../ansible/roles/database/tasks/mariadb_config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 -- cgit 1.2.3-korg