Add "plugin" option for users and allow to omit password

Set plugin to "unix_socket" to allow password-less socket-based authentication.
This commit is contained in:
Julian Rother 2025-09-13 22:15:53 +02:00
parent ea4ad3a2fd
commit 1bcf12fd37
No known key found for this signature in database
GPG key ID: 8F9B6AE9BAAE4899
2 changed files with 3 additions and 1 deletions

View file

@ -6,6 +6,7 @@ mariadb:
# mysql: # mysql:
# host: localhost # host: localhost
# password: foobar # password: foobar
# plugin: unix_socket # instead of password for password-less authentication
# priv: *.*:USAGE # priv: *.*:USAGE
dbs: {} dbs: {}
# database: # database:

View file

@ -28,7 +28,8 @@
login_unix_socket: /var/run/mysqld/mysqld.sock login_unix_socket: /var/run/mysqld/mysqld.sock
name: "{{ item.key }}" name: "{{ item.key }}"
host: "{{ item.value.host | default('localhost') }}" 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') }}" priv: "{{ item.value.priv | default('*.*:USAGE') }}"
with_dict: "{{ mariadb.users }}" with_dict: "{{ mariadb.users }}"