From 6b4a766db69a011edc9603e55f40565b08c82d3b Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 8 Oct 2024 16:55:01 +0200 Subject: [PATCH] Proceed with installation/upgrade even if cluster not healthy At the moment rabbitmq_upgrade flag is being used on unhealthy clusters to repair them. However with change [1] we've introduced running this task standalone very early during the playbook. In case cluster is unhelathy - there is no good way to repair it anymore as `rabbitmqctl cluster_status` might fail right away with. So let's ignore failures at this point and run feature_flags only if we were successfull on fetching the status. [1] https://review.opendev.org/q/Idf33b6810e1afb3a89dad5e65a48e86ac0a58a67 Change-Id: Ie453f327850f9c9ae54823c17b0292517fa56a82 --- tasks/rabbitmq_feature_flags.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/rabbitmq_feature_flags.yml b/tasks/rabbitmq_feature_flags.yml index 33b047a0..d9be1fc7 100644 --- a/tasks/rabbitmq_feature_flags.yml +++ b/tasks/rabbitmq_feature_flags.yml @@ -17,6 +17,7 @@ command: "rabbitmqctl cluster_status --formatter json" register: _cluster_status changed_when: False + failed_when: False tags: - rabbitmq-upgrade @@ -38,6 +39,7 @@ when: - (_feature_flags.stdout_lines | length)> 0 when: + - _cluster_status.rc == 0 - ((_cluster_status.stdout | from_json)['running_nodes'] | length) == (groups[rabbitmq_host_group] | length) - ((_cluster_status.stdout | from_json)['alarms'] | length) == 0 - ((_cluster_status.stdout | from_json)['partitions'] | length) == 0

AltStyle によって変換されたページ (->オリジナル) /