ansible-mysql/tasks/replication/slave/gtid.yml

27 lines
877 B
YAML
Raw Permalink Normal View History

---
- name: MYSQL_REPLICATION | Stop slave
community.mysql.mysql_replication:
mode: stopreplica
2022-03-04 16:56:27 +07:00
login_unix_socket: "{{ mariadb_socket }}"
- name: MYSQL_REPLICATION | Configure master host
community.mysql.mysql_replication:
mode: changeprimary
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 }}"
no_log: "{{ not mariadb_debug_role }}"
- name: MYSQL_REPLICATION | Setup replication with GTID
community.mysql.mysql_replication:
primary_use_gtid: current_pos
2022-03-04 16:56:27 +07:00
login_unix_socket: "{{ mariadb_socket }}"
- name: MYSQL_REPLICATION | Start slave
community.mysql.mysql_replication:
mode: startreplica
2022-03-04 16:56:27 +07:00
login_unix_socket: "{{ mariadb_socket }}"