]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
switch: resolve device path so we can umount the osd data dir
authorSébastien Han <seb@redhat.com>
Thu, 19 Apr 2018 12:45:03 +0000 (14:45 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 30 Apr 2018 06:15:18 +0000 (08:15 +0200)
If we don't do this, umounting devices declared like this
/dev/disk/by-id/ata-QEMU_HARDDISK_QM00001

will fail like:

umount: /dev/disk/by-id/ata-QEMU_HARDDISK_QM000011: mountpoint not found

Since we append '1' (partition 1), this won't work.
So we need to resolved the link to get something like /dev/sdb and then
append 1 to /dev/sdb1

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml

index b197b40cf6bc15b59cc63d709456c3bd2e1152eb..715ae7920cc7e895017252717351f4b29f26ab5b 100644 (file)
       with_items: "{{ devices }}"
       register: osd_running
 
+    - name: resolve device(s) path(s)
+      command: readlink -f {{ item }}
+      changed_when: false
+      with_items: "{{ devices }}"
+      register: devices_canonicalize
+
     - name: unmount all the osd directories
-      command: umount "{{ item.0 }}"1
+      command: umount "{{ item.0.stdout }}"1
       changed_when: false
       failed_when: false
       with_together:
-        - "{{ devices }}"
+        - "{{ devices_canonicalize.results }}"
         - "{{ osd_running.results }}"
       when:
         - item.1.get("rc", 0) != 0