From 9c35d3a5b192ef2dc4dfd694f1673ce315d47763 Mon Sep 17 00:00:00 2001 From: grakiss Date: Tue, 1 Mar 2016 20:25:49 -0500 Subject: FIX:access denied on centos7 after database cluster being created JIRA:COMPASS-327 - some unsed user records cause this authority issue - remove these records and restart mysql service Change-Id: I1a0fb6e8bf0690c7163680585d8cac653534ff3f Signed-off-by: grakiss --- .../roles/database/tasks/mariadb_config.yml | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml index 2ab10c0d..b18ae8f7 100644 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml +++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml @@ -36,3 +36,32 @@ host={{ item }} state=present with_items: ['%', 'localhost'] + +- name: remove unused user + script: remove_user.sh + when: ansible_os_family == "RedHat" + +- name: restart first nodes + service: + name: mysql + state: restarted + when: inventory_hostname == haproxy_hosts.keys()[0] and haproxy_hosts|length > 1 + +- name: wait for cluster ready + command: mysql -e"show status like 'wsrep%'" + register: cluster_status + until: cluster_status|success + failed_when: not cluster_status.stdout | search("ON") + retries: 10 + delay: 3 + when: + - inventory_hostname == haproxy_hosts.keys()[0] + +- name: restart other nodes + service: + name: mysql + state: restarted + enabled: yes + when: + - inventory_hostname != haproxy_hosts.keys()[0] + -- cgit 1.2.3-korg