From a8f518af9ff9cf1c60f61c929bd0bacaac94037f Mon Sep 17 00:00:00 2001 From: Juan Badia Payno Date: Wed, 24 Nov 2021 14:18:26 +0100 Subject: [PATCH] bnr - Remove the filter to backup the root grants [mysql] Currently the root user is rule out of the mysql grants backup when the backup of the mysql database is done. This means when the mysql backup is restored the operator needs to set back the mysql root password again if they want to use the same process. Closes-Bug: #1952099 Change-Id: Ia1ecbe53605f06b233df6406a0b9fe23e8ba22a8 (cherry picked from commit b50212faa8ecb297d6a569f8fbbb3cf9769d77f1) (cherry picked from commit d723ca9886ac61c1102ba520a4d9254d1af2775c) (cherry picked from commit b9a245b9f570c1a9754aef4fff981943a8819eb0) --- tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml b/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml index 3571ac11e..0973ae0f8 100644 --- a/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml +++ b/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml @@ -127,7 +127,7 @@ {{ tripleo_container_cli }} exec {{ tripleo_backup_and_restore_mysql_container }} bash -c "mysql -uroot \ -p{{ mysql_password.stdout }} -s -N \ -e \"SELECT CONCAT('\\\"SHOW GRANTS FOR ''',user,'''@''',host,''';\\\"') \ - FROM mysql.user where (length(user) > 0 and user NOT LIKE 'root' and \ + FROM mysql.user where (length(user) > 0 and \ (Host = 'localhost' or Host='%' or IS_IPV4(Host) or IS_IPV6(Host)))\" | xargs -n1 mysql \ -uroot -p{{ mysql_password.stdout }} -s -N -e | sed 's/$/;/' " > {{ tripleo_backup_and_restore_mysql_grants_file }} when: mysql_password.stderr is defined