From af3d23acc4533442f73434e23a645c2a1ca36c75 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Fri, 9 Aug 2013 15:40:13 +0900 Subject: [PATCH] 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. --- recipes/osd.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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