2019-10-17 19:35:11 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: 'Copy MySQL configuration for replication'
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2019-10-17 19:35:11 +02:00
|
|
|
src: 'replication.cnf.j2'
|
|
|
|
dest: "{{ mysql_config_directory }}/zzzz-replication.cnf"
|
2020-01-13 17:50:24 +01:00
|
|
|
mode: "0644"
|
2019-10-17 19:35:11 +02:00
|
|
|
notify: 'restart mysql'
|
|
|
|
|
|
|
|
- name: 'Create repl user'
|
2023-03-20 23:33:19 +01:00
|
|
|
community.mysql.mysql_user:
|
2019-10-17 19:35:11 +02:00
|
|
|
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'
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.apt:
|
2019-10-17 19:35:11 +02:00
|
|
|
name: 'xinetd'
|
|
|
|
|
|
|
|
- name: 'Add xinetd configuration for MySQL HAProxy check'
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2019-10-17 19:35:11 +02:00
|
|
|
src: 'xinetd/mysqlchk'
|
|
|
|
dest: '/etc/xinetd.d/'
|
|
|
|
mode: '0644'
|
|
|
|
notify: 'restart xinetd'
|
|
|
|
|
2019-10-18 16:40:14 +02:00
|
|
|
# /!\ Warning, this is a temporary hack
|
2023-03-20 23:33:19 +01:00
|
|
|
- ansible.builtin.include_role:
|
2019-10-18 16:40:14 +02:00
|
|
|
name: remount-usr
|
|
|
|
|
2019-10-17 19:35:11 +02:00
|
|
|
- name: 'Copy mysqlchk script'
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2019-10-17 19:35:11 +02:00
|
|
|
src: 'xinetd/mysqlchk.sh'
|
|
|
|
dest: '/usr/share/scripts/'
|
|
|
|
mode: '0755'
|