Skip to content

Commit 4e9831d

Browse files
seunghun1eebbezak
authored andcommitted
Tweak RabbitMQ version check to allow 3.13 to 4.1
Since RabbitMQ 4.1 supports the upgrade from 3.13 [1], the assert condition and ``upgrade_version`` was adjusted accordingly. [1] https://www.rabbitmq.com/docs/upgrade#rabbitmq-version-upgradability Change-Id: I86eb058f88b49fcbbc4e219d5329aa6f0a339b95 Closes-Bug: #2118452 Signed-off-by: Seunghun Lee <[email protected]> (cherry picked from commit cca5ecf)
1 parent 282fa1a commit 4e9831d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ansible/roles/rabbitmq/tasks/version-check.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@
5050
new_version_major: "{{ rabbitmq_version_new.stdout | regex_search('^[0-9]+') }}"
5151
new_version_minor: "{{ rabbitmq_version_new.stdout | regex_search('(?<=.)[^.].') }}"
5252
new_version: "{{ rabbitmq_version_new.stdout | regex_replace('.[^.]+$', '') }}"
53-
# Note: this assumes 3.13 will be the last release before 4.0.
54-
upgrade_version: "{{ '4.0' if current_version == '3.13' else current_version_major + '.' + (current_version_minor | int + 1) | string }}"
53+
# Note: 3.13 is the last release before 4.0.
54+
upgrade_version: "{{ '4.0 or 4.1' if current_version == '3.13' else current_version_major + '.' + (current_version_minor | int + 1) | string }}"
5555
assert:
5656
that: (current_version_major == new_version_major and
5757
new_version_minor | int - current_version_minor | int <= 1) or
58-
(new_version | float == 4.0 and current_version | float == 3.13)
58+
(new_version | float == 4.0 and current_version | float == 3.13) or
59+
(new_version | float == 4.1 and current_version | float == 3.13)
5960
fail_msg: >
6061
Looks like you're trying to run a skip-release upgrade!
6162
RabbitMQ must be at most one version behind the target release version ({{ rabbitmq_version_new.stdout | trim }}) to run this upgrade.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
fixes:
4+
- |
5+
Fixes bug `LP#2118452 <https://bugs.launchpad.net/kolla-ansible/+bug/2118452>`__
6+
which stopped the RabbitMQ upgrade from version 3.13 to 4.1 even though it
7+
is supported.

0 commit comments

Comments
 (0)