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
This commit is contained in:
Damien Ciabrini 2018-06-13 16:29:07 +02:00
parent 7028d4fbe8
commit 3f56cd2304

View File

@ -139,13 +139,14 @@ outputs:
# Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done # Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done
command: command:
- 'bash' - 'bash'
- '-ecx' - '-ec'
- -
list_join: list_join:
- "\n" - "\n"
- - 'if [ -e /var/lib/mysql/mysql ]; then exit 0; fi' - - 'if [ -e /var/lib/mysql/mysql ]; then exit 0; fi'
- 'echo -e "\n[mysqld]\nwsrep_provider=none" >> /etc/my.cnf' - '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 &' - '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''' - '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'';"' - 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "CREATE USER ''mysql''@''localhost'';"'