ansible-roles/mysql/tasks/replication.yml
Patrick Marchand 1a96616f42 Fix right problem in mysql replication
The configuration file was not set to 0644, which caused the file
to be ignored by mysql and it's configuration not to be set.
2020-06-01 12:01:01 -04:00

42 lines
931 B
YAML

---
- name: 'Copy MySQL configuration for replication'
template:
src: 'replication.cnf.j2'
dest: "{{ mysql_config_directory }}/zzzz-replication.cnf"
mode: "0644"
notify: 'restart mysql'
- name: 'Create repl user'
mysql_user:
name: 'repl'
host: '%'
encrypted: true
password: "{{ mysql_repl_password }}"
priv: '*.*:REPLICATION SLAVE,REPLICATION CLIENT'
update_password: 'on_create'
state: 'present'
register: create_repl_user
when: mysql_repl_password | length > 0
- name: 'Install xinetd'
apt:
name: 'xinetd'
- name: 'Add xinetd configuration for MySQL HAProxy check'
copy:
src: 'xinetd/mysqlchk'
dest: '/etc/xinetd.d/'
mode: '0644'
notify: 'restart xinetd'
# /!\ Warning, this is a temporary hack
- include_role:
name: remount-usr
- name: 'Copy mysqlchk script'
copy:
src: 'xinetd/mysqlchk.sh'
dest: '/usr/share/scripts/'
mode: '0755'