Browse Source

bnr: Fixed the ERROR 1141 when users has fqdn

When the environment is deployed with TLS-e, the galera database has the user associates to these
hosts:
 - %
 - VIP
 - FQDN

The grants for the hosts % and VIP are populated. The FQDN ones are not populated.
So when the script to backup the grant of the users is executed, it shows an
irrelevant error like:

ERROR 1141 (42000) at line 1: There is no such grant defined for user "cinder"
on host "control.internal.api.example".

This patch backs up the grants of the users associate to:
 - %
 - localhost
 - IPV4
 - IPV6

Change-Id: I2b0c9a443cc1167a0183daf59ec2db3d4fc07d74
(cherry picked from commit 669b4f0192)
(cherry picked from commit dc832f3416)
changes/56/813756/2
Juan Badia Payno 9 months ago
parent
commit
ae49288d3c
  1. 3
      tripleo_ansible/roles/backup-and-restore/backup/tasks/db_backup.yml

3
tripleo_ansible/roles/backup-and-restore/backup/tasks/db_backup.yml

@ -127,7 +127,8 @@
{{ 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')\" | xargs -n1 mysql \
FROM mysql.user where (length(user) > 0 and user NOT LIKE 'root' 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
tags:

Loading…
Cancel
Save