From: Simo Kinnunen Date: Fri, 9 Aug 2013 06:40:13 +0000 (+0900) Subject: Add a "type" field to OSD devices. When the value is "directory", the directory ... X-Git-Tag: v0.2.0~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F60%2Fhead;p=ceph-cookbooks.git Add a "type" field to OSD devices. When the value is "directory", the directory (specified by the "device" field) is automatically created and activated, as udev will not pick it up automatically. --- diff --git a/recipes/osd.rb b/recipes/osd.rb index e18613c..92d6154 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -114,8 +114,17 @@ else if osd_device["encrypted"] == true dmcrypt = "--dmcrypt" end + create_cmd = "ceph-disk-prepare #{dmcrypt} #{osd_device['device']} #{osd_device['journal']}" + if osd_device["type"] == "directory" + directory osd_device["device"] do + owner "root" + group "root" + recursive true + end + create_cmd << " && ceph-disk-activate #{osd_device['device']}" + end execute "Creating Ceph OSD on #{osd_device['device']}" do - command "ceph-disk-prepare #{dmcrypt} #{osd_device['device']} #{osd_device['journal']}" + command create_cmd action :run notifies :create, "ruby_block[save osd_device status]" end