Skip to content

Commit

Permalink
Added changelog fragment and renamed commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Pfahl committed Jan 21, 2021
1 parent 7343b02 commit 0883f8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- mysql_replication - added options to `start_group_replication` and `stop_group_replication`
16 changes: 8 additions & 8 deletions plugins/modules/mysql_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
C(resetmaster) (RESET MASTER) - supported since community.mysql 0.1.0,
C(resetslave) (RESET SLAVE),
C(resetslaveall) (RESET SLAVE ALL).
C(startgroupreplication) (START GROUP_REPLICATION).
C(stopgroupreplication) (STOP GROUP_REPLICATION).
C(start_group_replication) (START GROUP_REPLICATION).
C(stop_group_replication) (STOP GROUP_REPLICATION).
type: str
choices:
- changemaster
Expand All @@ -44,8 +44,8 @@
- resetmaster
- resetslave
- resetslaveall
- startgroupreplication
- stopgroupreplication
- start_group_replication
- stop_group_replication
default: getslave
master_host:
description:
Expand Down Expand Up @@ -232,7 +232,7 @@
- name: Start mysql group replication
community.mysql.mysql_replication:
mode: startgroupreplication
mode: start_group_replication
'''

Expand Down Expand Up @@ -448,7 +448,7 @@ def main():
mode=dict(type='str', default='getslave', choices=[
'getmaster', 'getslave', 'changemaster', 'stopslave',
'startslave', 'resetmaster', 'resetslave', 'resetslaveall',
'startgroupreplication', 'stopgroupreplication']),
'start_group_replication', 'stop_group_replication']),
master_auto_position=dict(type='bool', default=False),
master_host=dict(type='str'),
master_user=dict(type='str'),
Expand Down Expand Up @@ -629,14 +629,14 @@ def main():
module.exit_json(msg="Slave reset", changed=True, queries=executed_queries)
else:
module.exit_json(msg="Slave already reset", changed=False, queries=executed_queries)
elif mode in "startgroupreplication":
elif mode in "start_group_replication":
started = start_group_replication(module, cursor, fail_on_error)
if started is True:
module.exit_json(msg="Group replication started ", changed=True, queries=executed_queries)
else:
module.exit_json(msg="Group replication already started (Or cannot be started)", changed=False,
ueries=executed_queries)
elif mode in "stopgroupreplication":
elif mode in "stop_group_replication":
stopped = stop_group_replication(module, cursor, channel, fail_on_error)
if stopped is True:
module.exit_json(msg="Group replication stopped", changed=True, queries=executed_queries)
Expand Down

0 comments on commit 0883f8a

Please sign in to comment.