2015-08-11 15:22:58 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Stop slave
|
2018-03-18 00:28:56 +07:00
|
|
|
mysql_replication:
|
|
|
|
mode: stopslave
|
2015-08-11 15:22:58 +07:00
|
|
|
|
2019-12-29 01:02:41 +07:00
|
|
|
- name: MYSQL_REPLICATION | Configure master host
|
|
|
|
mysql_replication:
|
|
|
|
mode: changemaster
|
|
|
|
master_host: "{{ mariadb_replication_host }}"
|
|
|
|
master_port: "{{ mariadb_replication_port }}"
|
|
|
|
master_user: "{{ mariadb_replication_user }}"
|
|
|
|
master_password: "{{ mariadb_replication_password }}"
|
|
|
|
|
|
|
|
# -- Wait this PR in Ansible released version (https://github.com/ansible/ansible/pull/62648)
|
|
|
|
# name: MYSQL_REPLICATION | Setup replication with GTID
|
|
|
|
# mysql_replication:
|
|
|
|
# master_use_gtid: current_pos
|
|
|
|
|
|
|
|
- name: COMMAND | Configure GTID
|
2018-03-18 00:47:35 +07:00
|
|
|
command: mariadb -e "CHANGE MASTER TO master_use_gtid=current_pos";
|
2019-12-29 01:02:41 +07:00
|
|
|
changed_when: true
|
2015-08-11 15:22:58 +07:00
|
|
|
|
|
|
|
- name: MYSQL_REPLICATION | Start slave
|
2018-03-18 00:28:56 +07:00
|
|
|
mysql_replication:
|
|
|
|
mode: startslave
|