From 08b06809f2b2f820de85fbd95ac38a98bca2918f Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Fri, 15 Sep 2023 22:02:56 +0200 Subject: [PATCH] Only setup mysql slave when not already setup --- ansible/roles/mysql-replication/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/mysql-replication/tasks/main.yaml b/ansible/roles/mysql-replication/tasks/main.yaml index bd0cbe3..73117cd 100644 --- a/ansible/roles/mysql-replication/tasks/main.yaml +++ b/ansible/roles/mysql-replication/tasks/main.yaml @@ -57,7 +57,7 @@ master_log_pos: "{{ hostvars['web1'].repl_stat.Position }}" master_user: "{{ mysql.replication_user }}" master_password: "{{ mysql_replication_pass }}" - when: ansible_hostname in mysql.replication_slaves + when: ansible_hostname in mysql.replication_slaves and not slave.Is_Slave - name: Start slave replication community.mysql.mysql_replication: