From: QiLiang Date: Wed, 7 Sep 2016 02:46:46 +0000 (+0800) Subject: Restart mysql in centos-no-ha scenario X-Git-Tag: colorado.1.0~18^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=11f6bd1154b5ad29aab7382feb28868dfbf9a88f;p=compass4nfv.git Restart mysql in centos-no-ha scenario JIRA: COMPASS-482 Change-Id: Id26a0acbe9b725e236021a4b324960eef02b48eb Signed-off-by: QiLiang --- 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