mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-04 05:04:23 -07:00
add service name to plugin pam/auth_pam usage
This commit is contained in:
parent
7defd8e728
commit
a9299d57e0
2 changed files with 13 additions and 3 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
|
||||
if plugin = 'pam' or plugin = 'auth_pam':
|
||||
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
|
||||
if plugin = 'pam' or plugin = 'auth_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