Bump RabbitMQ version to 4.0

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/934042
Change-Id: I231ea65b5340c43bffb541ce23d3a8e600015c2d
This commit is contained in:
Dmitriy Rabotyagov 2024-11-04 16:49:30 +01:00
parent 1396510eb8
commit fef83101a6
6 changed files with 55 additions and 8 deletions

View File

@ -297,9 +297,11 @@ rabbitmq_log:
rabbitmq_policies: []
rabbitmq_apply_openstack_policies: False
rabbitmq_openstack_policies:
- name: "HA"
pattern: '^(?!(amq\.)|(.*_fanout_)).*'
tags: "ha-mode=all"
- name: CQv2
pattern: '.*'
priority: 0
tags:
queue-version: 2
rabbitmq_port_bindings:
ssl_listeners:

View File

@ -0,0 +1,16 @@
---
features:
- |
RabbitMQ version is upgraded to a new major version 4.0
upgrade:
- |
Please, make sure you are running RabbitMQ version of 3.13 before
proceeding with the upgrade.
In case you RabbitMQ version is lower then 3.13 upgrade to 4.0 will
fail.
You can run upgrade to 3.13 with same version of role by
supplying variable ``rabbitmq_package_version`` during runtime, for
example:
``openstack-ansible openstack.osa.rabbitmq_server -e rabbitmq_upgrade=true -e rabbitmq_package_version=3.13.7-1``
and then re-running upgrade normally to 4.0.

View File

@ -23,7 +23,6 @@
failed_when: false
register: installed_rabbitmq_deb
when:
- not rabbitmq_upgrade | bool
- ansible_facts['pkg_mgr'] == 'apt'
tags:
- rabbitmq-package-deb
@ -40,7 +39,6 @@
failed_when: false
register: installed_rabbitmq_rpm
when:
- not rabbitmq_upgrade | bool
- ansible_facts['pkg_mgr'] == 'dnf'
tags:
- rabbitmq-package-rpm
@ -56,7 +54,7 @@
- "{{ installed_rabbitmq_deb }}"
- "{{ installed_rabbitmq_rpm }}"
- name: Compare installed version of RabbitMQ with new version variable
- name: Ensure installed RabbitMQ version is same as expected
fail:
msg: "To install a new major/minor version of RabbitMQ set '-e rabbitmq_upgrade=true'."
when:
@ -69,6 +67,25 @@
- rabbitmq-package-rpm
- rabbitmq-apt-packages
- name: Ensure that RabbitMQ is running minimal required version for upgrade
fail:
msg: |
Minimal required version for proceeding with RabbitMQ upgrade to {{ rabbitmq_package_version }} is {{ _minimal_required_version }}.
Please, upgrade to the version {{ _minimal_required_version }} before proceeding with further upgrade.
Current detected version is {{ installed_rabbitmq.stdout }}.
vars:
_minimal_required_version: >-
{{ (_rabbitmq_upgrade_minimal_requirement_mapping | selectattr('target', 'in', rabbitmq_package_version) | first)['requirement'] }}
when:
- rabbitmq_upgrade | bool
- installed_rabbitmq.rc == 0
- installed_rabbitmq.stdout is version(_minimal_required_version, '<')
- rabbitmq_install_method != 'distro'
tags:
- rabbitmq-package-deb
- rabbitmq-package-rpm
- rabbitmq-apt-packages
- name: Including rabbitmq_cluster_state tasks
include_tasks: rabbitmq_cluster_state.yml
args:

View File

@ -14,7 +14,7 @@
# limitations under the License.
_rabbitmq_install_method: external_repo
_rabbitmq_package_version: "3.13.7-1"
_rabbitmq_package_version: "4.0.3-1"
_rabbitmq_erlang_package_version: "26.2.*-1"
_rabbitmq_repo_url: "https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/{{ ansible_facts['distribution'] | lower }}"

View File

@ -22,3 +22,15 @@ _rabbitmq_is_last_play_host: >-
{{
(inventory_hostname == (groups[rabbitmq_host_group] | intersect(ansible_play_hosts)) | last) | bool
}}
_rabbitmq_upgrade_minimal_requirement_mapping:
- target: "4.0"
requirement: "3.13"
- target: "3.13"
requirement: "3.11"
- target: "3.12"
requirement: "3.11"
- target: "3.11"
requirement: "3.10"
- target: "3.10"
requirement: "3.7"

View File

@ -14,7 +14,7 @@
# limitations under the License.
_rabbitmq_install_method: external_repo
_rabbitmq_package_version: "3.13.7-1"
_rabbitmq_package_version: "4.0.3-1"
# NOTE(nhanlon) 2023-05-30: although the package repository is marked
# el9, the packages themselves still have an el8 dist tag for rabbitmq
_rabbitmq_package_dist_tag: "el8"