Skip to content

Commit 9f19908

Browse files
committed
Check both is_replica and is_slave
1 parent 3fb888a commit 9f19908

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Replication settings. Set `mysql_server_id` and `mysql_replication_role` by serv
164164

165165
`mysql_replication_master` needs to resolve to an IP or a hostname which is accessable to the Slaves (this could be a `/etc/hosts` injection or some other means), otherwise the slaves cannot communicate to the master.
166166

167-
If the replication master has different IP addresses where you are running ansible and where the mysql replica is running, you can *optionally* specify a `mysql_replication_master_inventory_host` to access the machine (e.g. you run ansible on your local machine, but the mysql master and replica need to communicate behind a vpn)
167+
If the replication master has different IP addresses where you are running ansible and where the mysql replica is running, you can *optionally* specify a `mysql_replication_master_inventory_host` to access the machine (e.g. you run ansible on your local machine, but the mysql master and replica need to communicate on a different network)
168168

169169
### Later versions of MySQL on CentOS 7
170170

tasks/replication.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
delegate_to: "{{ mysql_replication_master_inventory_host }}"
3030
register: master
3131
when:
32-
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Slave is not defined and slave is failed)
32+
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)
3333
- mysql_replication_role == 'slave'
3434
- (mysql_replication_master | length) > 0
3535
tags: ['skip_ansible_galaxy']
@@ -44,7 +44,7 @@
4444
master_log_pos: "{{ master.Position }}"
4545
ignore_errors: true
4646
when:
47-
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Slave is not defined and slave is failed)
47+
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)
4848
- mysql_replication_role == 'slave'
4949
- mysql_replication_user.name is defined
5050
- (mysql_replication_master | length) > 0

0 commit comments

Comments
 (0)