From 5fa92804f92a065514012c77a6bd8530b77fd008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 19 Apr 2018 14:45:03 +0200 Subject: [PATCH] switch: resolve device path so we can umount the osd data dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-authored-by: Guillaume Abrioux --- ...non-containerized-to-containerized-ceph-daemons.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index b197b40cf..715ae7920 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -258,12 +258,18 @@ 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