Reduce verbosity during mysql bootstrap

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.

Closes-Bug: #1765339

Change-Id: I90827feff0d1b9fd8badb72e68e4c8dd8db8aea5
This commit is contained in:
Damien Ciabrini 2018-04-19 19:00:32 +00:00
parent a5b913e1eb
commit a246549303

View File

@ -184,13 +184,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 ''clustercheck''@''localhost'' IDENTIFIED BY ''${DB_CLUSTERCHECK_PASSWORD}'';"'