aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/database')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/main.yml4
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml18
2 files changed, 22 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/main.yml b/deploy/adapters/ansible/roles/database/tasks/main.yml
index 124b2639..f28da23b 100644
--- a/deploy/adapters/ansible/roles/database/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/main.yml
@@ -10,9 +10,13 @@
- include_vars: "{{ ansible_os_family }}.yml"
tags:
- test_mongo
+ - recovery
- include: mariadb_install.yml
+
- include: mariadb_cluster.yml
+ tags:
+ - recovery
- include: mariadb_config.yml
when:
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