From 5fd299e358f0917c8b05b918272a576ff46b82dd Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 26 Mar 2021 16:12:42 +0100 Subject: [PATCH] update: followup on 07029e1 Playbook must fail anyway, the `rescue` block has been introduced for unmasking the unit after the playbook has failed. Signed-off-by: Guillaume Abrioux (cherry picked from commit e9ddb972fef5ab73e3a6f4f95f451ae223dcf64c) --- infrastructure-playbooks/rolling_update.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 190fec578..786561a58 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -269,12 +269,9 @@ rescue: - name: unmask the mon service systemd: - name: ceph-mon@{{ item }} + name: ceph-mon@{{ ansible_facts['hostname'] }} enabled: yes masked: no - with_items: - - "{{ ansible_facts['hostname'] }}" - - "{{ ansible_facts['fqdn'] }}" - name: unmask the mgr service systemd: @@ -283,6 +280,10 @@ when: inventory_hostname in groups[mgr_group_name] | default([]) or groups[mgr_group_name] | default([]) | length == 0 + - name: stop the playbook execution + fail: + msg: "There was an error during monitor upgrade. Please, check the previous task results." + - name: reset mon_host hosts: "{{ mon_group_name|default('mons') }}" become: True -- 2.39.5