From 25456872c4c14483aa1fe8d4567b1cfa3537c9b6 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 13 Jun 2018 10:59:25 -0700 Subject: [PATCH] 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 --- docker/services/database/mysql.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/services/database/mysql.yaml b/docker/services/database/mysql.yaml index ce118be851..aa8ea4181d 100644 --- a/docker/services/database/mysql.yaml +++ b/docker/services/database/mysql.yaml @@ -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