From 93b955406d971a400d54ca1690da0a815293c945 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Wed, 4 Sep 2024 09:31:16 +0200 Subject: [PATCH] mysql_user: add correct ed25519 plugin handling when creating a user --- changelogs/fragments/0-mysql_user.yml | 2 ++ plugins/module_utils/user.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/0-mysql_user.yml diff --git a/changelogs/fragments/0-mysql_user.yml b/changelogs/fragments/0-mysql_user.yml new file mode 100644 index 00000000..61a9a017 --- /dev/null +++ b/changelogs/fragments/0-mysql_user.yml @@ -0,0 +1,2 @@ +bugfixes: +- mysql_user - add correct ``ed25519`` auth plugin handling when creating a user (https://github.com/ansible-collections/community.mysql/issues/672). diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py index 7d7d304b..58ed6071 100644 --- a/plugins/module_utils/user.py +++ b/plugins/module_utils/user.py @@ -212,7 +212,7 @@ def user_add(cursor, user, host, host_all, password, encrypted, query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string) elif plugin and 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 + if plugin in ('pam', 'ed25519'): # 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) elif salt: if plugin in ['caching_sha2_password', 'sha256_password']: