From 8f02bb007f4231917adccdb0b04811dd26051037 Mon Sep 17 00:00:00 2001 From: Caleb Boylan Date: Mon, 27 Nov 2017 16:02:36 -0800 Subject: [PATCH] Add support for using loopback devices as OSDs This is particularly useful in CI environments where you dont have the option of adding extra devices or volumes to the host. It is also a simple change to support loopback devices --- roles/ceph-osd/tasks/activate_osds.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index bedd475e0..7b4bf1620 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -3,7 +3,7 @@ # partition. - name: activate osd(s) when device is a disk - command: ceph-disk activate {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 + command: ceph-disk activate "{{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\1p') | regex_replace('^(\/dev\/loop[0-9]{1})$', '\1p') }}1" with_items: - "{{ devices|unique }}" changed_when: false @@ -13,7 +13,7 @@ - not dmcrypt - name: activate osd(s) when device is a disk (dmcrypt) - command: ceph-disk activate --dmcrypt {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 + command: ceph-disk activate --dmcrypt "{{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\1p') | regex_replace('^(\/dev\/loop[0-9]{1})$', '\1p') }}1" with_items: - "{{ devices|unique }}" changed_when: false