From fb22b242fee57256199c394758adc7bb80052d61 Mon Sep 17 00:00:00 2001 From: Martin Schurz Date: Sat, 11 Nov 2023 04:22:24 +0100 Subject: [PATCH] better compare for utf8 Signed-off-by: Martin Schurz --- molecule/mysql_hardening/verify_tasks/mysql_users.yml | 1 - roles/mysql_hardening/tasks/mysql_secure_installation.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/molecule/mysql_hardening/verify_tasks/mysql_users.yml b/molecule/mysql_hardening/verify_tasks/mysql_users.yml index f08cb78b..392c8dad 100644 --- a/molecule/mysql_hardening/verify_tasks/mysql_users.yml +++ b/molecule/mysql_hardening/verify_tasks/mysql_users.yml @@ -37,7 +37,6 @@ ansible.builtin.assert: that: - '"role_keep@" in mysql_users_list' - login_unix_socket: "{{ login_unix_socket | default(omit) }}" when: - mysql_role_support.rowcount[0] > 0 diff --git a/roles/mysql_hardening/tasks/mysql_secure_installation.yml b/roles/mysql_hardening/tasks/mysql_secure_installation.yml index 387eac07..889c98df 100644 --- a/roles/mysql_hardening/tasks/mysql_secure_installation.yml +++ b/roles/mysql_hardening/tasks/mysql_secure_installation.yml @@ -66,7 +66,7 @@ AND USER NOT IN ('mysql.sys', 'mysqlxsys', 'mariadb.sys') - {{ 'AND is_role COLLATE utf8mb4_general_ci = "N"' if mysql_role_support.rowcount[0] > 0 }}; + {{ 'AND convert(is_role USING utf8) = "N"' if mysql_role_support.rowcount[0] > 0 }}; login_unix_socket: "{{ login_unix_socket | default(omit) }}" register: mysql_users_wo_passwords_or_auth_string check_mode: false