]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: check if rbdmap exists
authorBenoît Knecht <bknecht@protonmail.ch>
Fri, 31 Jul 2020 06:11:31 +0000 (08:11 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 6 Aug 2020 16:04:51 +0000 (12:04 -0400)
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 a57fd7a0900e5c3d04e8b6c997c819d340565967)

infrastructure-playbooks/purge-cluster.yml

index 1c615de375a6d9465997830530681715aa83f4f2..a428361ed8ff976633fc26d0268fcca6ecdd3b24 100644 (file)
     - 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: