kolla-ansible/tests/upgrade.sh
Matt Crees b86c304a29 Enable RabbitMQ HA queues by default
Sets the variable ``om_enable_rabbitmq_high_availability`` to ``true``
by default. An upgrade will therefore require some manual steps to
migrate from transient to durable queues. Note that this will be
caught by this precheck:
https://review.opendev.org/c/openstack/kolla-ansible/+/880274

Also updates the CI upgrade jobs to perform this migration. This will
need to be removed in Caracal.

Related-Bug: #2031294

Change-Id: I26a70d4722aaa4663eced5f5337840474c7b961c
2023-08-25 10:10:04 +00:00

57 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -o xtrace
set -o errexit
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
function upgrade {
RAW_INVENTORY=/etc/kolla/inventory
source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
kolla-ansible -i ${RAW_INVENTORY} -vvv prechecks --skip-tags rabbitmq-ha-precheck &> /tmp/logs/ansible/upgrade-prechecks
kolla-ansible -i ${RAW_INVENTORY} -vvv pull &> /tmp/logs/ansible/pull-upgrade
# NOTE(mattcrees): As om_enable_rabbitmq_high_availability now defaults to
# true in Bobcat, we need to perform a migration to durable queues.
# TODO(mattcrees): Remove these steps in Caracal (and the precheck flag above).
SERVICE_TAGS="heat,keystone,neutron,nova"
if [[ $SCENARIO == "zun" ]] || [[ $SCENARIO == "cephadm" ]]; then
SERVICE_TAGS+=",cinder"
fi
if [[ $SCENARIO == "scenario_nfv" ]]; then
SERVICE_TAGS+=",barbican"
fi
if [[ $SCENARIO == "ironic" ]]; then
SERVICE_TAGS+=",ironic"
fi
if [[ $SCENARIO == "masakari" ]]; then
SERVICE_TAGS+=",masakari"
fi
if [[ $SCENARIO == "ovn" ]] || [[ $SCENARIO == "octavia" ]]; then
SERVICE_TAGS+=",octavia"
fi
if [[ $SCENARIO == "magnum" ]]; then
SERVICE_TAGS+=",magnum,designate"
fi
kolla-ansible -i ${RAW_INVENTORY} -vvv stop --tags $SERVICE_TAGS --yes-i-really-really-mean-it &> /tmp/logs/ansible/stop
kolla-ansible -i ${RAW_INVENTORY} -vvv genconfig &> /tmp/logs/ansible/genconfig
kolla-ansible -i ${RAW_INVENTORY} -vvv reconfigure --tags rabbitmq &> /tmp/logs/ansible/reconfigure-rabbitmq
kolla-ansible -i ${RAW_INVENTORY} -vvv rabbitmq-reset-state &> /tmp/logs/ansible/rabbitmq-reset-state
kolla-ansible -i ${RAW_INVENTORY} -vvv upgrade &> /tmp/logs/ansible/upgrade
# NOTE(yoctozepto): These actions remove the leftovers of the admin port.
# TODO(yoctozepto): Remove after Zed.
kolla-ansible -i ${RAW_INVENTORY} -vvv deploy --tags keystone &> /tmp/logs/ansible/upgrade-deploy
kolla-ansible -i ${RAW_INVENTORY} -vvv post-deploy &> /tmp/logs/ansible/upgrade-post-deploy
kolla-ansible -i ${RAW_INVENTORY} -vvv validate-config &> /tmp/logs/ansible/validate-config
}
upgrade