roles/mariadb: use socket for all operations

Otherwise Ansible will try to connect with host 'localhost', which
we do not use (and we have disabled name resolution anyways).
This commit is contained in:
Alan Orth 2021-09-07 16:48:15 +03:00
parent b60637c7d9
commit bd4ae36bb6
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -43,13 +43,13 @@
# See: https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_db_module.html
- name: Create MariaDB database(s)
mysql_db: db={{ item.name }} state=present encoding=utf8mb4
mysql_db: db={{ item.name }} state=present encoding=utf8mb4 login_unix_socket={{ mariadb_login_unix_socket }}
loop: "{{ mariadb_databases }}"
when: mariadb_databases is defined
tags: mariadb
- name: Create MariaDB user(s)
mysql_user: name={{ item.user }} password={{ item.pass }} priv={{ item.name }}.*:ALL host=127.0.0.1 state=present
mysql_user: name={{ item.user }} password={{ item.pass }} priv={{ item.name }}.*:ALL host=127.0.0.1 state=present login_unix_socket={{ mariadb_login_unix_socket }}
loop: "{{ mariadb_databases }}"
when: mariadb_databases is defined
tags: mariadb