From 3f56cd230462a124170b201702eff4e13bef9c03 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Wed, 13 Jun 2018 16:29:07 +0200 Subject: [PATCH] Reduce verbosity during mysql bootstrap, non-HA During the initial deployment, a one-time container is used to bootstrap the mysql databse on disk, create the required users and set their password. The script that runs that is too verbose and logs some credentials in the container's logs and in the journal. Use kolla_extend_start directly instead of kolla_start to stop tracing shell commands and reduce logging to the bare minimum for troubleshooting. This is the non-HA counterpart of I90827feff0d1b9fd8badb72e68e4c8dd8db8aea5, which is now also used to set up containerized undercloud. Change-Id: Ib583fa92d279fc3166cceaf58e152b5cce315d44 Closes-Bug: #1765339 --- docker/services/database/mysql.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/services/database/mysql.yaml b/docker/services/database/mysql.yaml index 3e67ff3a1d..5260743229 100644 --- a/docker/services/database/mysql.yaml +++ b/docker/services/database/mysql.yaml @@ -139,13 +139,14 @@ outputs: # Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done command: - 'bash' - - '-ecx' + - '-ec' - list_join: - "\n" - - 'if [ -e /var/lib/mysql/mysql ]; then exit 0; fi' - 'echo -e "\n[mysqld]\nwsrep_provider=none" >> /etc/my.cnf' - - 'sudo -u mysql -E kolla_start' + - 'kolla_set_configs' + - 'sudo -u mysql -E kolla_extend_start' - 'mysqld_safe --skip-networking --wsrep-on=OFF &' - '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 ''mysql''@''localhost'';"'