-
Notifications
You must be signed in to change notification settings - Fork 2
Support RabbitMQ minor version upgrades and Quorum migration #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,18 @@ | |
vars: | ||
kayobe_environment_path: "{{ src_directory }}/kayobe-config/etc/kayobe/environments/{{ kayobe_config_environment }}" | ||
|
||
- name: Revert RabbitMQ changes to avoid git conflicts (upgrade) | ||
ansible.builtin.shell: | ||
cmd: >- | ||
if grep "om_enable_rabbitmq_high_availability: false" {{ kayobe_environment_path }}/kolla/globals.yml ; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this do the right thing for:
(bearing in mind SKC may change over time...) |
||
sed -i -e 's/om_enable_rabbitmq_high_availability: false/om_enable_rabbitmq_high_availability: true/' \ | ||
-e 's/om_enable_rabbitmq_quorum_queues: true/om_enable_rabbitmq_quorum_queues: false/' \ | ||
{{ kayobe_environment_path }}/kolla/globals.yml | ||
fi | ||
when: upgrade | bool | ||
vars: | ||
kayobe_environment_path: "{{ src_directory }}/kayobe-config/etc/kayobe/environments/{{ kayobe_config_environment }}" | ||
|
||
- name: Stash Kayobe Config changes (upgrade) | ||
ansible.builtin.command: | ||
cmd: git stash | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,27 @@ function upgrade_overcloud() { | |
kayobe overcloud service upgrade | ||
} | ||
|
||
function rabbit_migration() { | ||
# Ensure RabbitMQ is upgraded to 3.13 | ||
if kayobe overcloud host command run -l controllers -b --command "docker exec rabbitmq rabbitmqctl --version | grep 3.11" --show-output; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: It shouldn't be an issue here, but you need to be careful with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not an issue right now, but RabbitMQ versions are split into three: e.g. 3.13.7. there is a chance they'll go all the way up to 3.13.11, which would also get caught by this grep |
||
kayobe kolla ansible run "rabbitmq-upgrade 3.12" | ||
fi | ||
if kayobe overcloud host command run -l controllers -b --command "docker exec rabbitmq rabbitmqctl --version | grep 3.12" --show-output; then | ||
kayobe kolla ansible run "rabbitmq-upgrade 3.13" | ||
fi | ||
|
||
# Set quorum flag and execute RabbitMQ queue migration script. | ||
if [[ -f $KAYOBE_CONFIG_PATH/../../tools/rabbitmq-quorum-migration.sh ]]; then | ||
sed -i -e 's/om_enable_rabbitmq_high_availability: true/om_enable_rabbitmq_high_availability: false/' \ | ||
-e 's/om_enable_rabbitmq_quorum_queues: false/om_enable_rabbitmq_quorum_queues: true/' \ | ||
$KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/kolla/globals.yml | ||
$KAYOBE_CONFIG_PATH/../../tools/rabbitmq-quorum-migration.sh | ||
else | ||
echo "Migration script not found. Check Openstack Release" | ||
return 1 | ||
fi | ||
} | ||
|
||
function usage() { | ||
set +x | ||
|
||
|
@@ -351,6 +372,7 @@ function usage() { | |
echo " build_kayobe_image" | ||
echo " run_tempest" | ||
echo " upgrade_overcloud" | ||
echo " rabbit_migration" | ||
} | ||
|
||
function main() { | ||
|
@@ -373,7 +395,7 @@ function main() { | |
$cmd | ||
;; | ||
# Standard commands. | ||
(build_kayobe_image|deploy_full|deploy_seed|deploy_overcloud|deploy_wazuh|create_resources|run_tempest|upgrade_overcloud) | ||
(build_kayobe_image|deploy_full|deploy_seed|deploy_overcloud|deploy_wazuh|create_resources|run_tempest|upgrade_overcloud|rabbit_migration) | ||
setup | ||
$cmd | ||
report_success | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff gets a bit fiddly, and brittle when considering support for multiple releases. Longer term it probably needs a different solution, like writing the config overrides to a specific file that can be deleted on upgrade.