include_recipe "ceph::conf"
service_type = node["ceph"]["mon"]["init_style"]
-service "ceph_mon" do
- case service_type
- when "upstart"
- service_name "ceph-mon-all"
- provider Chef::Provider::Service::Upstart
- action :enable
- when "sysvinit"
- service_name "ceph"
- provider Chef::Provider::Service::Init
- end
- supports :restart => true
-end
directory "/var/run/ceph" do
owner "root"
execute 'ceph-mon mkfs' do
command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'"
- notifies :restart, "service[ceph_mon]", :immediately
end
ruby_block "finalise" do
end
end
+service "ceph_mon" do
+ case service_type
+ when "upstart"
+ service_name "ceph-mon-all"
+ provider Chef::Provider::Service::Upstart
+ when "sysvinit"
+ service_name "ceph"
+ provider Chef::Provider::Service::Init
+ end
+ supports :restart => true
+ action [ :enable, :start ]
+end
+
get_mon_addresses().each do |addr|
execute "peer #{addr}" do
command "ceph --admin-daemon '/var/run/ceph/ceph-mon.#{node['hostname']}.asok' add_bootstrap_peer_hint #{addr}"