Skip to content

Commit

Permalink
purge-cluster: check if rbdmap exists
Browse files Browse the repository at this point in the history
When running `infrastructure-playbooks/purge-cluster.yml` twice, it fails the
second time on the `ensure rbd devices are unmapped` task, because `rbdmap`
isn't installed anymore at that point.

This commit adds a check that ensures `rbdmap` is available, and skips the
`ensure rbd devices are unmapped` task if it isn't.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit a57fd7a)
  • Loading branch information
BenoitKnecht authored and dsavineau committed Aug 6, 2020
1 parent 92b400f commit 5d06c0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions infrastructure-playbooks/purge-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@
- name: ensure cephfs mountpoint(s) are unmounted
command: umount -a -t ceph

- name: check if rbdmap is still installed
command: command -v rbdmap
register: command_rbdmap
failed_when: false
changed_when: false

- name: ensure rbd devices are unmapped
command: rbdmap unmap-all
when: command_rbdmap.rc == 0

- name: unload ceph kernel modules
modprobe:
Expand Down

0 comments on commit 5d06c0e

Please sign in to comment.