Skip to content

Commit 64bbe25

Browse files
committed
Allow replication against masters without a .my.conf file.
This adds the REPLICATION CLIENT grant to the replication user, which is necessary to run the SHOW MASTER STATUS command as a non-root user.
1 parent 259cc2d commit 64bbe25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tasks/replication.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
name: "{{ mysql_replication_user.name }}"
55
host: "{{ mysql_replication_user.host | default('%') }}"
66
password: "{{ mysql_replication_user.password }}"
7-
priv: "{{ mysql_replication_user.priv | default('*.*:REPLICATION SLAVE') }}"
7+
priv: "{{ mysql_replication_user.priv | default('*.*:REPLICATION SLAVE,REPLICATION CLIENT') }}"
88
state: present
99
when: >
1010
(mysql_replication_role == 'master')
1111
and mysql_replication_user
1212
and (mysql_replication_master != '')
1313
1414
- name: Check slave replication status.
15-
mysql_replication: mode=getslave
15+
mysql_replication:
16+
mode: getslave
17+
login_user: "{{ mysql_replication_user.name }}"
18+
login_password: "{{ mysql_replication_user.password }}"
1619
ignore_errors: true
1720
register: slave
1821
when: >

0 commit comments

Comments
 (0)