aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/tasks/mariadb.yml
diff options
context:
space:
mode:
authoryour name <email@163.com>2015-09-09 03:26:11 -0400
committeryour name <email@163.com>2015-09-09 03:26:11 -0400
commit72039e915d1fc960bd0d7fccd910ea282d61bee7 (patch)
tree60452129b1b9f3c3419b4a29a038f5f0cbade5f7 /deploy/adapters/ansible/roles/database/tasks/mariadb.yml
parentcf87d3067a63cb8be315a3addfd9c27d86be3b5a (diff)
Compass Netconfig optimization
Change-Id: Icbcfc7d794623436f22be5f6763b212a25d4fac7 JIRA: COMPASS-30
Diffstat (limited to 'deploy/adapters/ansible/roles/database/tasks/mariadb.yml')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb.yml20
1 files changed, 18 insertions, 2 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb.yml
index dbd76c68..3626777b 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb.yml
@@ -1,4 +1,9 @@
---
+#- name: delete default maridb-libs
+# action: "{{ ansible_pkg_mgr }} name=mariadb-libs state=absent"
+# when: ansible_os_family == "RedHat"
+# ignore_errors: True
+
- name: install python-mysqldb
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: maridb_packages | union(packages_noarch)
@@ -19,8 +24,19 @@
- name: update wsrep_sst_rsync gid
lineinfile: dest=/usr/bin/wsrep_sst_rsync state=absent regexp="\s*gid = \$MYGID$" backup=yes
-- name: manually restart mysql server
+- name: restart first mysql server
+ shell: service mysql restart --wsrep-cluster-address="gcomm://"
+ when: inventory_hostname == haproxy_hosts.keys()[0]
+ register: result
+ until: result|success
+ retries: 5
+ delay: 5
+ tags:
+ - mysql_restart
+
+- name: restart other mysql server
service: name=mysql state=restarted enabled=yes
+ when: inventory_hostname != haproxy_hosts.keys()[0]
register: result
until: result|success
retries: 5
@@ -34,6 +50,6 @@
- name: create database/user
shell: /opt/data.sh
- when: HA_CLUSTER[inventory_hostname] == ''
+ run_once: True
tags:
- mysql_user