]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Add a "type" field to OSD devices. When the value is "directory", the directory ... 60/head
authorSimo Kinnunen <simo@shoqolate.com>
Fri, 9 Aug 2013 06:40:13 +0000 (15:40 +0900)
committerSimo Kinnunen <simo@shoqolate.com>
Fri, 9 Aug 2013 06:40:13 +0000 (15:40 +0900)
recipes/osd.rb

index e18613c83e6c1675ae54cb8ec8c8e9a33853f090..92d6154aee024823395d5b801cb5ea0aa1322066 100644 (file)
@@ -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