Don't use libraries for things that must be in attributes
This commit is contained in:
parent
8d147a16bf
commit
bcad750c80
6
attributes/mon.rb
Normal file
6
attributes/mon.rb
Normal 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
6
attributes/osd.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
case node['platform']
|
||||||
|
when 'ubuntu'
|
||||||
|
default["ceph"]["osd"]["init_style"] = "upstart"
|
||||||
|
else
|
||||||
|
default["ceph"]["osd"]["init_style"] = "sysvinit"
|
||||||
|
end
|
@ -118,12 +118,3 @@ def have_quorum?()
|
|||||||
state = JSON.parse(mon_status)['state']
|
state = JSON.parse(mon_status)['state']
|
||||||
return QUORUM_STATES.include?(state)
|
return QUORUM_STATES.include?(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
def service_type()
|
|
||||||
case node['platform']
|
|
||||||
when 'ubuntu'
|
|
||||||
return "upstart"
|
|
||||||
else
|
|
||||||
return "sysvinit"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
@ -19,7 +19,7 @@ require 'json'
|
|||||||
include_recipe "ceph::default"
|
include_recipe "ceph::default"
|
||||||
include_recipe "ceph::conf"
|
include_recipe "ceph::conf"
|
||||||
|
|
||||||
service_type = service_type()
|
service_type = node["ceph"]["mon"]["init_style"]
|
||||||
service "ceph_mon" do
|
service "ceph_mon" do
|
||||||
case service_type
|
case service_type
|
||||||
when "upstart"
|
when "upstart"
|
||||||
|
@ -44,7 +44,7 @@ if !search(:node,"hostname:#{node['hostname']} AND dmcrypt:true").empty?
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
service_type = service_type()
|
service_type = node["ceph"]["osd"]["init_style"]
|
||||||
service "ceph_osd" do
|
service "ceph_osd" do
|
||||||
case service_type
|
case service_type
|
||||||
when "sysvinit"
|
when "sysvinit"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user