diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2025-09-23 18:30:48 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2026-10-01 06:37:22 +0000 |
| commit | 1d088ebeeb38de7b4656e92d62e9e10640736b8e (patch) | |
| tree | 28bfc69cab57c6c2436864bad734caae845e8719 /kolla/docker/keystone/keystone-api/extend_start.sh | |
| parent | f7db20a52d68a9b979208ef5c97b95dd55f7bf48 (diff) | |
| download | kolla-1d088ebeeb38de7b4656e92d62e9e10640736b8e.tar.gz kolla-1d088ebeeb38de7b4656e92d62e9e10640736b8e.zip | |
keystone: Introduce keystone-api container
It's a clone of keystone container image.
After using the new container in Kolla-Ansible - the old keystone
container image can be dropped.
Change-Id: Ia5684a4c5e5eb25fa5194dac9f841b0793203718
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'kolla/docker/keystone/keystone-api/extend_start.sh')
| -rw-r--r-- | kolla/docker/keystone/keystone-api/extend_start.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/kolla/docker/keystone/keystone-api/extend_start.sh b/kolla/docker/keystone/keystone-api/extend_start.sh new file mode 100644 index 000000000..b45c94d0d --- /dev/null +++ b/kolla/docker/keystone/keystone-api/extend_start.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Create log dir for Keystone logs +KEYSTONE_LOG_DIR="/var/log/kolla/keystone" +if [[ ! -d "${KEYSTONE_LOG_DIR}" ]]; then + mkdir -p ${KEYSTONE_LOG_DIR} +fi +if [[ $(stat -c %U:%G ${KEYSTONE_LOG_DIR}) != "keystone:kolla" ]]; then + chown keystone:kolla ${KEYSTONE_LOG_DIR} +fi +if [ ! -f "${KEYSTONE_LOG_DIR}/keystone.log" ]; then + touch ${KEYSTONE_LOG_DIR}/keystone.log +fi +if [[ $(stat -c %U:%G ${KEYSTONE_LOG_DIR}/keystone.log) != "keystone:keystone" ]]; then + chown keystone:keystone ${KEYSTONE_LOG_DIR}/keystone.log +fi +if [[ $(stat -c %a ${KEYSTONE_LOG_DIR}) != "755" ]]; then + chmod 755 ${KEYSTONE_LOG_DIR} +fi + +EXTRA_KEYSTONE_MANAGE_ARGS=${EXTRA_KEYSTONE_MANAGE_ARGS-} +# Upgrade and exit if KOLLA_UPGRADE variable is set. This catches all cases +# of the KOLLA_UPGRADE variable being set, including empty. +if [[ "${!KOLLA_UPGRADE[@]}" ]]; then + # TODO(duonghq): check doctor result here + # TODO: find reason why doctor failed in gate + # sudo -H -u keystone keystone-manage doctor + sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --expand + sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --migrate + exit 0 +fi + +# Contract database and exit if KOLLA_FINISH_UPGRADE variable is set. +# This catches all cases of the KOLLA_FINISH_UPGRADE variable being set, +# including empty. +if [[ "${!KOLLA_FINISH_UPGRADE[@]}" ]]; then + sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --contract + exit 0 +fi + +# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases +# of the KOLLA_BOOTSTRAP variable being set, including empty. +if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then + sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync + exit 0 +fi |
