From 1bcf12fd37ead357a7f770f3a809e430bdce3f20 Mon Sep 17 00:00:00 2001 From: Julian Rother Date: Sat, 13 Sep 2025 22:15:53 +0200 Subject: [PATCH] Add "plugin" option for users and allow to omit password Set plugin to "unix_socket" to allow password-less socket-based authentication. --- defaults/main.yml | 1 + tasks/main.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index b7ceabf..1270f25 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,6 +6,7 @@ mariadb: # mysql: # host: localhost # password: foobar +# plugin: unix_socket # instead of password for password-less authentication # priv: *.*:USAGE dbs: {} # database: diff --git a/tasks/main.yml b/tasks/main.yml index fc05e35..a726203 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,7 +28,8 @@ login_unix_socket: /var/run/mysqld/mysqld.sock name: "{{ item.key }}" host: "{{ item.value.host | default('localhost') }}" - password: "{{ item.value.password }}" + password: "{{ item.value.password | default(omit) }}" + plugin: "{{ item.value.plugin | default(omit) }}" priv: "{{ item.value.priv | default('*.*:USAGE') }}" with_dict: "{{ mariadb.users }}"