]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
update: followup on 07029e1
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 26 Mar 2021 15:12:42 +0000 (16:12 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Mar 2021 08:54:44 +0000 (10:54 +0200)
Playbook must fail anyway, the `rescue` block has been introduced for
unmasking the unit after the playbook has failed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e9ddb972fef5ab73e3a6f4f95f451ae223dcf64c)

infrastructure-playbooks/rolling_update.yml

index 3e7009b86c712cc78117767e3af7f26e35d7031d..ae14fbfd7d4c84cad235d68da37fce33ea17f76d 100644 (file)
       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:
           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