From 5a8f5b74c40d7a9073566362873eb4cc749f1ce6 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 2 Sep 2021 14:44:44 +0200 Subject: [PATCH] Use module mysql_replication instead of command for GTID setup --- tasks/replication/slave/gtid.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tasks/replication/slave/gtid.yml b/tasks/replication/slave/gtid.yml index c2dd0be..c036e0b 100644 --- a/tasks/replication/slave/gtid.yml +++ b/tasks/replication/slave/gtid.yml @@ -13,14 +13,9 @@ master_password: "{{ mariadb_replication_password }}" no_log: "{{ not mariadb_debug_role }}" -# -- 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 - command: mariadb -e "CHANGE MASTER TO master_use_gtid=current_pos"; - changed_when: true +- name: MYSQL_REPLICATION | Setup replication with GTID + mysql_replication: + primary_use_gtid: current_pos - name: MYSQL_REPLICATION | Start slave mysql_replication: