]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Don't use libraries for things that must be in attributes
authorGuilhem Lettron <guilhem@lettron.fr>
Tue, 9 Apr 2013 12:27:50 +0000 (14:27 +0200)
committerGuilhem Lettron <guilhem@lettron.fr>
Thu, 2 May 2013 09:09:00 +0000 (11:09 +0200)
attributes/mon.rb [new file with mode: 0644]
attributes/osd.rb [new file with mode: 0644]
libraries/default.rb
recipes/mon.rb
recipes/osd.rb

diff --git a/attributes/mon.rb b/attributes/mon.rb
new file mode 100644 (file)
index 0000000..9120c78
--- /dev/null
@@ -0,0 +1,6 @@
+case node['platform']
+when 'ubuntu'
+  default["ceph"]["mon"]["init_style"] = "upstart"
+else
+  default["ceph"]["mon"]["init_style"] = "sysvinit"
+end
diff --git a/attributes/osd.rb b/attributes/osd.rb
new file mode 100644 (file)
index 0000000..a005afc
--- /dev/null
@@ -0,0 +1,6 @@
+case node['platform']
+when 'ubuntu'
+  default["ceph"]["osd"]["init_style"] = "upstart"
+else
+  default["ceph"]["osd"]["init_style"] = "sysvinit"
+end
index 5ba19950fb7383e28ef233e0aa9df27f2e10e182..69ae4cd20a4cfd3ec53d362c10407f8d4b603eaf 100644 (file)
@@ -118,12 +118,3 @@ def have_quorum?()
     state = JSON.parse(mon_status)['state']
     return QUORUM_STATES.include?(state)
 end
-
-def service_type()
-  case node['platform']
-  when 'ubuntu'
-    return "upstart"
-  else
-    return "sysvinit"
-  end
-end
index 0d15dc9f5d899327c0905ab1a6575eccf7027e4e..6522ecc57f30b23a798b9820356c9a4efddd2f79 100644 (file)
@@ -19,7 +19,7 @@ require 'json'
 include_recipe "ceph::default"
 include_recipe "ceph::conf"
 
-service_type = service_type()
+service_type = node["ceph"]["mon"]["init_style"]
 service "ceph_mon" do
   case service_type
   when "upstart"
index 20bc04d85849c4cbc969b81765a39197cf05e0a5..eb70b1c4d08f7d1257e7d3c0743b5f358082311b 100644 (file)
@@ -44,7 +44,7 @@ if !search(:node,"hostname:#{node['hostname']} AND dmcrypt:true").empty?
     end
 end
 
-service_type = service_type()
+service_type = node["ceph"]["osd"]["init_style"]
 service "ceph_osd" do
   case service_type
   when "sysvinit"