From 321779dafd80aa02b032c344a7cf3b72f25c93b4 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sun, 1 Dec 2024 18:31:54 +0100 Subject: [PATCH] fix .my.cnf somehow --- mysql/pkg.ansible.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mysql/pkg.ansible.yml b/mysql/pkg.ansible.yml index 896a161..54c8710 100644 --- a/mysql/pkg.ansible.yml +++ b/mysql/pkg.ansible.yml @@ -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: