Don't use libraries for things that must be in attributes

This commit is contained in:
Guilhem Lettron 2013-04-09 14:27:50 +02:00
parent 8d147a16bf
commit bcad750c80
5 changed files with 14 additions and 11 deletions

6
attributes/mon.rb Normal file
View File

@ -0,0 +1,6 @@
case node['platform']
when 'ubuntu'
default["ceph"]["mon"]["init_style"] = "upstart"
else
default["ceph"]["mon"]["init_style"] = "sysvinit"
end

6
attributes/osd.rb Normal file
View File

@ -0,0 +1,6 @@
case node['platform']
when 'ubuntu'
default["ceph"]["osd"]["init_style"] = "upstart"
else
default["ceph"]["osd"]["init_style"] = "sysvinit"
end

View 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

View 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"

View 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"