2015-08-11 15:22:58 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Stop slave
|
2024-08-26 15:12:09 +07:00
|
|
|
community.mysql.mysql_replication:
|
2018-03-18 00:28:56 +07:00
|
|
|
mode: stopslave
|
2022-03-04 16:56:27 +07:00
|
|
|
login_unix_socket: "{{ mariadb_socket }}"
|
2015-08-11 15:22:58 +07:00
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Configure master host
|
2024-08-26 15:12:09 +07:00
|
|
|
community.mysql.mysql_replication:
|
2018-03-18 00:28:56 +07:00
|
|
|
mode: changemaster
|
|
|
|
master_host: "{{ mariadb_replication_host }}"
|
|
|
|
master_port: "{{ mariadb_replication_port }}"
|
|
|
|
master_user: "{{ mariadb_replication_user }}"
|
|
|
|
master_password: "{{ mariadb_replication_password }}"
|
2022-03-04 16:56:27 +07:00
|
|
|
login_unix_socket: "{{ mariadb_socket }}"
|
2021-09-01 17:24:40 +07:00
|
|
|
no_log: "{{ not mariadb_debug_role }}"
|
2015-08-11 15:22:58 +07:00
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Change master
|
2024-08-26 15:12:09 +07:00
|
|
|
community.mysql.mysql_replication:
|
2018-03-18 00:28:56 +07:00
|
|
|
mode: changemaster
|
|
|
|
master_log_file: "{{ mariadb_master_log_file }}"
|
|
|
|
master_log_pos: "{{ mariadb_master_log_pos }}"
|
2022-03-04 16:56:27 +07:00
|
|
|
login_unix_socket: "{{ mariadb_socket }}"
|
2018-03-17 23:28:54 +07:00
|
|
|
when: mariadb_master_log_file is defined and mariadb_master_log_pos is defined
|
2015-08-11 15:22:58 +07:00
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Start slave
|
2024-08-26 15:12:09 +07:00
|
|
|
community.mysql.mysql_replication:
|
2018-03-18 00:28:56 +07:00
|
|
|
mode: startslave
|
2022-03-04 16:56:27 +07:00
|
|
|
login_unix_socket: "{{ mariadb_socket }}"
|