File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
chef/cookbooks/ceph/recipes Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 2222
2323mon_name = get_ceph_client_name ( node )
2424
25+ package "ceph-mgr"
26+ package "ceph-mon"
2527directory "/var/lib/ceph/mon/ceph-#{ mon_name } " do
2628 owner "ceph"
2729 group "ceph"
3032 action :create
3133end
3234
35+ directory "/var/lib/ceph/mgr/ceph-#{ mon_name } " do
36+ owner "ceph"
37+ group "ceph"
38+ mode "0750"
39+ recursive true
40+ action :create
41+ end
42+
3343# TODO cluster name
3444cluster = "ceph"
3545
143153 service "ceph-mon.target" do
144154 action :enable
145155 end
156+ service "ceph-mgr.target" do
157+ action :enable
158+ end
146159 service "ceph.target" do
147160 action :enable
148161 end
187200 end
188201 end
189202end
203+
204+
205+ unless File . exist? ( "/var/lib/ceph/mgr/ceph-#{ mon_name } /done" )
206+ keyring = "/var/lib/ceph/mgr/#{ cluster } -#{ mon_name } /keyring"
207+ execute "create mgr keyring" do
208+ command "ceph auth get-or-create mgr.#{ mon_name } \
209+ mon 'allow profile mgr' osd 'allow *' mds 'allow *' \
210+ -o #{ keyring } && \
211+ chown ceph.ceph #{ keyring } "
212+ not_if { File . exist? ( keyring ) }
213+ end
214+ ruby_block "finalise" do
215+ block do
216+ [ "done" ] . each do |ack |
217+ File . open ( "/var/lib/ceph/mgr/ceph-#{ mon_name } /#{ ack } " , "w" ) . close
218+ end
219+ end
220+ end
221+ end
222+
223+ service "ceph_mgr" do
224+ case service_type
225+ when "upstart"
226+ service_name "ceph-mgr-all-starter"
227+ provider Chef ::Provider ::Service ::Upstart
228+ when "systemd"
229+ service_name "ceph-mgr@#{ mon_name } "
230+ else
231+ service_name "ceph"
232+ end
233+ supports restart : true , status : true
234+ action [ :enable , :start ]
235+ subscribes :restart , resources ( template : "/etc/ceph/ceph.conf" )
236+ end
You can’t perform that action at this time.
0 commit comments