From e6e331ff7bcd57598b687463b2868fc1f12dc89a Mon Sep 17 00:00:00 2001 From: lhahn Date: Sat, 10 Aug 2024 23:28:17 +0200 Subject: [PATCH] fix mariadb clean --- tasks/main.yml | 3 +-- templates/root/secure_install.sql.j2 | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index a5adab2..762e746 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -84,8 +84,7 @@ - name: run initial cleanup shell: | - mysql - --defaults-extra-file /root/mdb_local.cnf + mariadb --no-auto-rehash < /root/secure_install.sql when: mdb_install.changed diff --git a/templates/root/secure_install.sql.j2 b/templates/root/secure_install.sql.j2 index 6ba1ade..1482062 100755 --- a/templates/root/secure_install.sql.j2 +++ b/templates/root/secure_install.sql.j2 @@ -1,4 +1,4 @@ DELETE FROM mysql.user WHERE User='{{ mariadb_root_user }}' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); DROP DATABASE IF EXISTS test; -DELETE FROM mysql.db WHERE Db='test' OR Db='test_%' +DELETE FROM mysql.db WHERE Db='test' OR Db='test_%'; FLUSH PRIVILEGES; \ No newline at end of file