]> 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>
Fri, 26 Mar 2021 20:27:02 +0000 (21:27 +0100)
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>
infrastructure-playbooks/rolling_update.yml

index a80a792921983e0d1db518fbae3da3cbfe675f2b..757a8714cd36716f6e3065f214f84c59b0d41760 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