openstack-ansible-galera_se.../tasks/galera_post_install.yml
Darren Birkett b9a7361b28 ensure mysql defaults file is sourced
The mysql initscript that comes with mariadb-10.0 does not source the
/etc/default/mysql file, meaning that the MYSQLD_STARTUP_TIMEOUT that
we set in there is being ignored.  This has the effect of causing some
nodes to timeout their startup too early, interrupting the initial SST,
and causing the cluster join to fail.

This commit adds a line to the initscript to ensure that we are
sourcing /etc/default/mysql correctly.

Closes-Bug: #1569446
Co-Authored-By: Jimmy McCrory <jimmy.mccrory@gmail.com>

Change-Id: I6af1cc660c2bbc2a49707cfab995659dc0167f2f
2016-04-15 09:44:31 +00:00

96 lines
2.8 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create the local directories
file:
path: "{{ item.path }}"
state: "directory"
owner: "{{ item.owner|default('root') }}"
group: "{{ item.group|default('root') }}"
mode: "{{ item.mode|default('0755') }}"
recurse: "{{ item.recurse|default('false') }}"
with_items:
- { path: "/var/lib/mysql", owner: "mysql", mode: "2755" }
- { path: "/var/log/mysql", owner: "mysql", mode: "2755" }
- { path: "/var/log/mysql_logs/", owner: "mysql", group: "syslog", mode: "2755" }
- { path: "/etc/mysql/conf.d" }
tags:
- galera-config
- name: Drop mariadb config(s)
config_template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "root"
group: "root"
mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items:
- src: my.cnf.j2
dest: /etc/mysql/my.cnf
config_overrides: "{{ galera_my_cnf_overrides }}"
config_type: "ini"
- src: cluster.cnf.j2
dest: /etc/mysql/conf.d/cluster.cnf
config_overrides: "{{ galera_cluster_cnf_overrides }}"
config_type: "ini"
- src: debian.cnf.j2
dest: /etc/mysql/debian.cnf
config_overrides: "{{ galera_debian_cnf_overrides }}"
config_type: "ini"
notify: Restart mysql
tags:
- galera-client-user-config
# NOTE: (mancdaz) this should not be needed with mariadb-10.1 since its
# initscript sources /etc/default/mariadb
- name: fix mysql startup timeout
lineinfile:
dest: /etc/init.d/mysql
state: present
insertafter: '^export HOME=/etc/mysql/'
line: '[ -r /etc/default/mysql ] && . /etc/default/mysql'
backup: yes
# NOTE: (mancdaz) The target will need to change to /etc/default/mariadb
# for mariadb-10.1
- name: Drop mariadb config(s)
template:
src: "mysql_defaults.j2"
dest: "/etc/default/mysql"
mode: "0644"
notify: Restart mysql
tags:
- galera-config
- name: remove default mysql_safe_syslog
file:
path: "/etc/mysql/conf.d/mysqld_safe_syslog.cnf"
state: absent
tags:
- galera-config
- name: Remove policy-rc
file:
path: "/usr/sbin/policy-rc.d"
state: absent
tags:
- galera-config
- include: galera_upgrade_post.yml
when:
- galera_upgrade | bool