From 88d7a964b9207d94e61afac4457808bf709f5c49 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sun, 1 Dec 2024 19:49:12 +0100 Subject: [PATCH] Try to fix .my.cnf --- mysql/pkg.ansible.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mysql/pkg.ansible.yml b/mysql/pkg.ansible.yml index 54c8710..dfb8689 100644 --- a/mysql/pkg.ansible.yml +++ b/mysql/pkg.ansible.yml @@ -12,15 +12,20 @@ - 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}}" - + 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: Update ~/.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: