undercloud: manage mysql user + revoke grant during upgrade

This task is done when bootstraping a new deployment but we also need to
run these commands when upgrading the containerized undercloud so
healthcheck can run mysql commands from mysql user.

Change-Id: Ie77785caba0a1fb8e2058a998b21cc88bc666fd7
Closes-Bug: #1776570
This commit is contained in:
Emilien Macchi 2018-06-13 10:59:25 -07:00
parent c36bad9780
commit 25456872c4
1 changed files with 7 additions and 0 deletions

View File

@ -268,6 +268,13 @@ outputs:
fi
become: true
when: {get_param: UndercloudUpgrade}
# https://bugs.launchpad.net/tripleo/+bug/1776570
- name: Manage mysql user for healthcheck and revoke grant
shell: |
mysql -e "CREATE USER IF NOT EXISTS \`mysql\`@\`localhost\`;"
mysql -e "REVOKE ALL PRIVILEGES, GRANT OPTION FROM \`mysql\`@\`localhost\`;"
become: true
when: {get_param: UndercloudUpgrade}
- name: Stop and disable mysql service
when: mariadb_enabled|bool
service: name=mariadb state=stopped enabled=no