ansible-roles/mysql/tasks/replication.yml
Jérémy Lecour ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2777|524|2253|2462|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Use FQCN
Fully Qualified Collection Name
2023-03-20 23:33:19 +01:00

42 lines
1 KiB
YAML

---
- name: 'Copy MySQL configuration for replication'
ansible.builtin.template:
src: 'replication.cnf.j2'
dest: "{{ mysql_config_directory }}/zzzz-replication.cnf"
mode: "0644"
notify: 'restart mysql'
- name: 'Create repl user'
community.mysql.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'
ansible.builtin.apt:
name: 'xinetd'
- name: 'Add xinetd configuration for MySQL HAProxy check'
ansible.builtin.copy:
src: 'xinetd/mysqlchk'
dest: '/etc/xinetd.d/'
mode: '0644'
notify: 'restart xinetd'
# /!\ Warning, this is a temporary hack
- ansible.builtin.include_role:
name: remount-usr
- name: 'Copy mysqlchk script'
ansible.builtin.copy:
src: 'xinetd/mysqlchk.sh'
dest: '/usr/share/scripts/'
mode: '0755'