mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 20:54:25 -07:00
Update mysql_user.py
Make the change a configureable boolean
This commit is contained in:
parent
7d2a23a38c
commit
027b7ee48b
1 changed files with 12 additions and 1 deletions
|
@ -74,6 +74,12 @@ options:
|
||||||
- Whether binary logging should be enabled or disabled for the connection.
|
- Whether binary logging should be enabled or disabled for the connection.
|
||||||
type: bool
|
type: bool
|
||||||
default: yes
|
default: yes
|
||||||
|
db_context:
|
||||||
|
description:
|
||||||
|
- Sets the mysql system database as context for the executed statements. Useful if you use
|
||||||
|
binlog / replication filters in MySQL.
|
||||||
|
type: bool
|
||||||
|
default: no
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether the user should exist.
|
- Whether the user should exist.
|
||||||
|
@ -341,6 +347,7 @@ def main():
|
||||||
plugin_hash_string=dict(default=None, type='str'),
|
plugin_hash_string=dict(default=None, type='str'),
|
||||||
plugin_auth_string=dict(default=None, type='str'),
|
plugin_auth_string=dict(default=None, type='str'),
|
||||||
resource_limits=dict(type='dict'),
|
resource_limits=dict(type='dict'),
|
||||||
|
db_context=dict(type='bool', default=False),
|
||||||
)
|
)
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=argument_spec,
|
argument_spec=argument_spec,
|
||||||
|
@ -365,7 +372,8 @@ def main():
|
||||||
ssl_key = module.params["client_key"]
|
ssl_key = module.params["client_key"]
|
||||||
ssl_ca = module.params["ca_cert"]
|
ssl_ca = module.params["ca_cert"]
|
||||||
check_hostname = module.params["check_hostname"]
|
check_hostname = module.params["check_hostname"]
|
||||||
db = 'mysql'
|
db = ''
|
||||||
|
db_context = module.params["db_context"]
|
||||||
sql_log_bin = module.params["sql_log_bin"]
|
sql_log_bin = module.params["sql_log_bin"]
|
||||||
plugin = module.params["plugin"]
|
plugin = module.params["plugin"]
|
||||||
plugin_hash_string = module.params["plugin_hash_string"]
|
plugin_hash_string = module.params["plugin_hash_string"]
|
||||||
|
@ -379,6 +387,9 @@ def main():
|
||||||
|
|
||||||
if mysql_driver is None:
|
if mysql_driver is None:
|
||||||
module.fail_json(msg=mysql_driver_fail_msg)
|
module.fail_json(msg=mysql_driver_fail_msg)
|
||||||
|
|
||||||
|
if db_context:
|
||||||
|
db = 'mysql'
|
||||||
|
|
||||||
cursor = None
|
cursor = None
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue