mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 00:11:26 -07:00
Initial switch to default=None for locked, will need to add a test for it.
Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys <es.rosenberg+github@gmail.com>
This commit is contained in:
parent
247bf5a65c
commit
41b6ff39bd
2 changed files with 4 additions and 3 deletions
|
@ -286,7 +286,7 @@ def is_hash(password):
|
||||||
def user_mod(cursor, user, host, host_all, password, encrypted,
|
def user_mod(cursor, user, host, host_all, password, encrypted,
|
||||||
plugin, plugin_hash_string, plugin_auth_string, salt, new_priv,
|
plugin, plugin_hash_string, plugin_auth_string, salt, new_priv,
|
||||||
append_privs, subtract_privs, attributes, tls_requires, module,
|
append_privs, subtract_privs, attributes, tls_requires, module,
|
||||||
password_expire, password_expire_interval, locked=False, role=False, maria_role=False):
|
password_expire, password_expire_interval, locked=None, role=False, maria_role=False):
|
||||||
changed = False
|
changed = False
|
||||||
msg = "User unchanged"
|
msg = "User unchanged"
|
||||||
grant_option = False
|
grant_option = False
|
||||||
|
@ -558,7 +558,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
||||||
if attribute_support:
|
if attribute_support:
|
||||||
final_attributes = attributes_get(cursor, user, host)
|
final_attributes = attributes_get(cursor, user, host)
|
||||||
|
|
||||||
if not role and user_is_locked(cursor, user, host) != locked:
|
if not role and locked is not None and user_is_locked(cursor, user, host) != locked:
|
||||||
if not module.check_mode:
|
if not module.check_mode:
|
||||||
if locked:
|
if locked:
|
||||||
cursor.execute("ALTER USER %s@%s ACCOUNT LOCK", (user, host))
|
cursor.execute("ALTER USER %s@%s ACCOUNT LOCK", (user, host))
|
||||||
|
|
|
@ -234,6 +234,7 @@ author:
|
||||||
- Lukasz Tomaszkiewicz (@tomaszkiewicz)
|
- Lukasz Tomaszkiewicz (@tomaszkiewicz)
|
||||||
- kmarse (@kmarse)
|
- kmarse (@kmarse)
|
||||||
- Laurent Indermühle (@laurent-indermuehle)
|
- Laurent Indermühle (@laurent-indermuehle)
|
||||||
|
- E.S. Rosenberg (@Keeper-of-the-Keys)
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.mysql.mysql
|
- community.mysql.mysql
|
||||||
|
@ -486,7 +487,7 @@ def main():
|
||||||
column_case_sensitive=dict(type='bool', default=None), # TODO 4.0.0 add default=True
|
column_case_sensitive=dict(type='bool', default=None), # TODO 4.0.0 add default=True
|
||||||
password_expire=dict(type='str', choices=['now', 'never', 'default', 'interval'], no_log=True),
|
password_expire=dict(type='str', choices=['now', 'never', 'default', 'interval'], no_log=True),
|
||||||
password_expire_interval=dict(type='int', required_if=[('password_expire', 'interval', True)], no_log=True),
|
password_expire_interval=dict(type='int', required_if=[('password_expire', 'interval', True)], no_log=True),
|
||||||
locked=dict(type='bool', default='false'),
|
locked=dict(type='bool'),
|
||||||
)
|
)
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=argument_spec,
|
argument_spec=argument_spec,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue