Skip to content

Commit 485ee87

Browse files
author
Dmitriy Rabotyagov
committed
Ensure that failures are fatal for upgrade_check
Ansible's fail will fail only current host in case of met conditions while continuing play for others. In order to prevent further execution for all hosts in case of unmet conditions, which may further break the cluster, `any_errors_fatal` was added to fail tasks. This will end the play for current batch and cancel further batches. Change-Id: I92f24c77b5fb8a3dd9ed17915d7c725d15f9f21e
1 parent 4655c91 commit 485ee87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tasks/rabbitmq_upgrade_check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
- name: Ensure installed RabbitMQ version is same as expected
5858
ansible.builtin.fail:
5959
msg: "To install a new major/minor version of RabbitMQ set '-e rabbitmq_upgrade=true'."
60+
any_errors_fatal: true
6061
when:
6162
- not rabbitmq_upgrade | bool
6263
- installed_rabbitmq.rc == 0
@@ -73,6 +74,7 @@
7374
Minimal required version for proceeding with RabbitMQ upgrade to {{ rabbitmq_package_version }} is {{ _minimal_required_version }}.
7475
Please, upgrade to the version {{ _minimal_required_version }} before proceeding with further upgrade.
7576
Current detected version is {{ installed_rabbitmq.stdout }}.
77+
any_errors_fatal: true
7678
vars:
7779
_minimal_required_version: >-
7880
{{ (_rabbitmq_upgrade_minimal_requirement_mapping | selectattr('target', 'in', rabbitmq_package_version) | first)['requirement'] }}
@@ -115,6 +117,7 @@
115117
_rabbitmq_cluster_upgrade_blockers: "{{ _rabbitmq_cluster_health_issues | selectattr('condition', 'true') }}"
116118
ansible.builtin.fail:
117119
msg: "{{ _rabbitmq_cluster_upgrade_blockers | map(attribute='msg') | join('\n') }}"
120+
any_errors_fatal: true
118121
when:
119122
- rabbitmq_upgrade | bool
120123
- _cluster_state

0 commit comments

Comments
 (0)