HA: drop spurious mysql user on stack deploy

In HA deployments, puppet-mysql is not in charge of deleting
all default users in the DB, so we end up keeping an extra
root@<controller-x> user that is never used nor supported for
password update. Make sure we delete it at creation time.

Change-Id: I0dbe6bd43ad0e6bcb884798912d195e94738c344
Closes-Bug: #1867165
This commit is contained in:
Damien Ciabrini 2020-03-12 17:06:14 +01:00
parent cfd16b082b
commit a67cfd0ba9
1 changed files with 1 additions and 0 deletions

View File

@ -240,6 +240,7 @@ outputs:
- 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''until mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" ping 2>/dev/null; do sleep 1; done'''
- 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "CREATE USER ''clustercheck''@''localhost'' IDENTIFIED BY ''${DB_CLUSTERCHECK_PASSWORD}'';"'
- 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "GRANT PROCESS ON *.* TO ''clustercheck''@''localhost'' WITH GRANT OPTION;"'
- 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "DELETE FROM mysql.user WHERE user = ''root'' AND host NOT IN (''%'',''localhost'');"'
- 'timeout ${DB_MAX_TIMEOUT} mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" shutdown'
volumes: &mysql_volumes
list_concat: