mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
add service name to plugin pam/auth_pam usage (#445)
* add service name to plugin pam/auth_pam usage * typo fixed * MySLQ is using identified with auth_pam by ... instead of identified with pam using ... like mariadb does * a : in description lines breaks yaml syntax * clearify documentation and add changelog fragment * Update changelogs/fragments/445_add_service_name_to_plugin_pam_auth_pam_usage.yml Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/module_utils/user.py Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
parent
eade7ec1f0
commit
8a579b42e3
3 changed files with 15 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 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