Skip to content

Commit bb7966f

Browse files
committed
Fixes geerlingguy#347: Fix replication deprecation warnings.
1 parent 9dfe01e commit bb7966f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ The rest of the settings in `defaults/main.yml` control MySQL's memory usage and
118118
mysql_expire_logs_days: "10"
119119
mysql_replication_role: ''
120120
mysql_replication_master: ''
121-
mysql_replication_user: []
121+
mysql_replication_user: {}
122122

123-
Replication settings. Set `mysql_server_id` and `mysql_replication_role` by server (e.g. the master would be ID `1`, with the `mysql_replication_role` of `master`, and the slave would be ID `2`, with the `mysql_replication_role` of `slave`). The `mysql_replication_user` uses the same keys as `mysql_users`, and is created on master servers, and used to replicate on all the slaves.
123+
Replication settings. Set `mysql_server_id` and `mysql_replication_role` by server (e.g. the master would be ID `1`, with the `mysql_replication_role` of `master`, and the slave would be ID `2`, with the `mysql_replication_role` of `slave`). The `mysql_replication_user` uses the same keys as individual list items in `mysql_users`, and is created on master servers, and used to replicate on all the slaves.
124124

125125
`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.
126126

tasks/replication.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
state: present
99
when:
1010
- mysql_replication_role == 'master'
11-
- mysql_replication_user
11+
- mysql_replication_user.name is defined
1212
- mysql_replication_master != ''
1313
tags: ['skip_ansible_galaxy']
1414

@@ -46,8 +46,8 @@
4646
when:
4747
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Slave is not defined and slave is failed)
4848
- mysql_replication_role == 'slave'
49+
- mysql_replication_user.name is defined
4950
- mysql_replication_master != ''
50-
- mysql_replication_user
5151

5252
- name: Start replication.
5353
mysql_replication: mode=startslave

0 commit comments

Comments
 (0)