fix .my.cnf somehow

This commit is contained in:
LinuxSquare 2024-12-01 18:31:54 +01:00
parent 5b29805865
commit 321779dafd

View file

@ -8,18 +8,19 @@
- mariadb-client
- mariadb-openrc
- py3-mysqlclient
- name: Set ~/.my.cnf file
template: src=files/mysql_secure-installation-my.conf.j2 dest=/root/.my.cnf mode=0600
vars:
MYSQL_ROOT_PASSWORD: "{{mysql_root_password}}"
- name: Update MariaDB root password
mysql_user: name=root host={{item}} password={{mysql_root_password}}
with_items:
- 127.0.0.1
- ::1
- localhost
- name: Set ~/.my.cnf file
template: src=files/mysql_secure-installation-my.conf.j2 dest=/root/.my.cnf mode=0600
vars:
MYSQL_ROOT_PASSWORD: "{{mysql_root_password}}"
- name: Delete anonymous MySQL user
mysql_user: name="" host={{item}} state=absent
with_items: