Add command to upgrade to a target version of RMQ

Required before a SLURP upgrade

Change-Id: I09a45d26a6075554b204e007f64122f23de5f53c
This commit is contained in:
Matt Crees 2024-05-09 17:18:41 +01:00
parent 416574c8b4
commit 249c1e89de
5 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,21 @@
---
- import_playbook: gather-facts.yml
- name: Group hosts based on configuration (RabbitMQ Only)
hosts: all
gather_facts: false
max_fail_percentage: >-
{{ group_hosts_max_fail_percentage |
default(kolla_max_fail_percentage) |
default(100) }}
tasks:
- name: Group hosts based on enabled services (RabbitMQ Only)
group_by:
key: "enable_rabbitmq_{{ enable_rabbitmq | bool }}"
changed_when: false
tags: always
- import_playbook: rabbitmq.yml
vars:
kolla_action: upgrade
rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/rabbitmq-{{ rabbitmq_version_suffix | regex_replace('\\.', '-') }}"

View File

@ -98,3 +98,5 @@ rabbitmq_plugins:
rabbitmq_enabled_plugins: "{{ rabbitmq_plugins | selectattr('enabled', 'equalto', true) | list }}"
kolla_externally_managed_cert: False
rabbitmq_version_suffix: ""

View File

@ -163,3 +163,47 @@ additional steps needed to migrate from transient to durable queues.
.. code-block:: console
kolla-ansible deploy --tags <service-tags>
SLURP
~~~~~
RabbitMQ has two major version releases per year but does not support jumping
two versions in one upgrade. So if you want to perform a skip-level upgrade,
you must first upgrade RabbitMQ to an intermediary version. To do this, Kolla
provides multiple RabbitMQ versions in the odd OpenStack releases. To use the
upgrade from Antelope to Caracal as an example, we start on RabbitMQ version
3.11. In Antelope, you should upgrade to RabbitMQ version 3.12 with the command
below. You can then proceed with the usual SLURP upgrade to Caracal (and
therefore RabbitMQ version 3.13).
.. warning::
This command should be run from the Antelope release.
.. code-block:: console
kolla-ansible rabbitmq-upgrade 3.12
RabbitMQ versions
~~~~~~~~~~~~~~~~~
Alternatively, you can set ``rabbitmq_image`` in your configuration
``globals.yml`` for idempotence in deployments. As an example, Kolla ships
versions 3.11, 3.12 and 3.13 of RabbitMQ in Antelope. By default, Antelope
Kolla-Ansible will deploy version 3.11. If you wish to deploy a later version,
you must override the image. if you want to use version 3.12 change
``rabbitmq_image`` in ``globals.yml`` as follows:
.. code-block:: yaml
rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/rabbitmq-3.12"
You can then upgrade RabbitMQ with the usual command:
.. code-block:: console
kolla-ansible upgrade --tags rabbitmq
Note again that RabbitMQ does not support upgrades between more than one major
version, so if you wish to upgrade to version 3.13 you must first upgrade to
3.12.

View File

@ -0,0 +1,6 @@
---
features:
- |
Added a command to upgrade to a target version of RabbitMQ. This is
required before a SLURP upgrade. See the docs for more details:
https://docs.openstack.org/kolla-ansible/latest/reference/message-queues/rabbitmq.html#slurp

View File

@ -199,6 +199,7 @@ Commands:
post-deploy Do post deploy on deploy node
pull Pull all images for containers (only pulls, no running container changes)
rabbitmq-reset-state Force reset the state of RabbitMQ
rabbitmq-upgrade <version> Upgrade to a specific version of RabbitMQ
reconfigure Reconfigure OpenStack service
stop Stop Kolla containers
certificates Generate self-signed certificate for TLS *For Development Only*
@ -247,6 +248,7 @@ gather-facts
post-deploy
pull
rabbitmq-reset-state
rabbitmq-upgrade
reconfigure
stop
certificates
@ -572,6 +574,12 @@ EOF
ACTION="Force reset the state of RabbitMQ"
PLAYBOOK="${BASEDIR}/ansible/rabbitmq-reset-state.yml"
;;
(rabbitmq-upgrade)
RMQ_VERSION="$2"
ACTION="Upgrade to a specific version of RabbitMQ"
PLAYBOOK="${BASEDIR}/ansible/rabbitmq-upgrade.yml"
EXTRA_OPTS="$EXTRA_OPTS -e rabbitmq_version_suffix=${RMQ_VERSION}"
;;
(bash-completion)
bash_completion
exit 0