Skip to content

Commit

Permalink
update: followup on 07029e1
Browse files Browse the repository at this point in the history
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 e9ddb97)
  • Loading branch information
guits committed Mar 29, 2021
1 parent 52a0b22 commit f60516d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions infrastructure-playbooks/rolling_update.yml
Expand Up @@ -261,12 +261,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:
Expand All @@ -275,6 +272,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
Expand Down

0 comments on commit f60516d

Please sign in to comment.