mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-25 03:41:26 -07:00
Merge branch 'ansible-collections:main' into lie_tests_using_containers
This commit is contained in:
commit
5538e17d75
11 changed files with 75 additions and 60 deletions
|
@ -170,7 +170,11 @@ def user_add(cursor, user, host, host_all, password, encrypted,
|
|||
elif plugin and plugin_hash_string:
|
||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string)
|
||||
elif plugin and plugin_auth_string:
|
||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||
# Mysql and MariaDB differ in naming pam plugin and Syntax to set it
|
||||
if plugin == 'pam': # Used by MariaDB which requires the USING keyword, not BY
|
||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string)
|
||||
else:
|
||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||
elif plugin:
|
||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s", (user, host, plugin)
|
||||
else:
|
||||
|
@ -305,7 +309,11 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
|||
if plugin_hash_string:
|
||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string)
|
||||
elif plugin_auth_string:
|
||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||
# Mysql and MariaDB differ in naming pam plugin and syntax to set it
|
||||
if plugin == 'pam':
|
||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string)
|
||||
else:
|
||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||
else:
|
||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s", (user, host, plugin)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue