From 9a5c965c0a0c847221acab963919cf0aaac7c25d Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 19 May 2026 15:50:45 +0800 Subject: [PATCH] fix: change secret of mysql --- .../automations/change_secret/database/mysql/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/accounts/automations/change_secret/database/mysql/main.yml b/apps/accounts/automations/change_secret/database/mysql/main.yml index b1d606668..12e3fa47b 100644 --- a/apps/accounts/automations/change_secret/database/mysql/main.yml +++ b/apps/accounts/automations/change_secret/database/mysql/main.yml @@ -37,8 +37,10 @@ client_cert: "{{ ssl_cert if check_ssl and ssl_cert | length > 0 else omit }}" client_key: "{{ ssl_key if check_ssl and ssl_key | length > 0 else omit }}" name: "{{ account.username }}" - password: "{{ account.secret }}" host: "%" + plugin: "{{ 'caching_sha2_password' if ('MariaDB' not in db_info.version.full and (db_info.version.full is version('8.0', '>='))) else omit }}" + plugin_auth_string: "{{ account.secret if ('MariaDB' not in db_info.version.full and (db_info.version.full is version('8.0', '>='))) else omit }}" + password: "{{ account.secret if ('MariaDB' in db_info.version.full or (db_info.version.full is version('8.0', '<'))) else omit }}" priv: "{{ omit if db_name == '' else db_name + '.*:ALL' }}" append_privs: "{{ db_name != '' | bool }}" ignore_errors: true