|
40 | 40 | action :create |
41 | 41 | end |
42 | 42 |
|
43 | | - |
44 | 43 | # TODO cluster name |
45 | 44 | cluster = "ceph" |
46 | 45 |
|
47 | | - |
48 | | -unless File.exist?("/var/lib/ceph/mgr/ceph-#{mon_name}/done") |
49 | | - keyring = "/var/lib/ceph/mgr/#{cluster}-#{mon_name}/keyring" |
50 | | - execute "create mgr keyring" do |
51 | | - command "ceph auth get-or-create mgr.#{mon_name} \ |
52 | | - mon 'allow profile mgr' osd 'allow *' mds 'allow *' \ |
53 | | - -o #{keyring} && \ |
54 | | - chown ceph.ceph #{keyring}" |
55 | | - not_if { File.exist?(keyring) } |
56 | | - end |
57 | | - ruby_block "finalise" do |
58 | | - block do |
59 | | - ["done"].each do |ack| |
60 | | - File.open("/var/lib/ceph/mgr/ceph-#{mon_name}/#{ack}", "w").close |
61 | | - end |
62 | | - end |
63 | | - end |
64 | | -end |
65 | | - |
66 | | -service "ceph_mgr" do |
67 | | - case service_type |
68 | | - when "upstart" |
69 | | - service_name "ceph-mgr-all-starter" |
70 | | - provider Chef::Provider::Service::Upstart |
71 | | - when "systemd" |
72 | | - service_name "ceph-mgr@#{mon_name}" |
73 | | - else |
74 | | - service_name "ceph" |
75 | | - end |
76 | | - supports restart: true, status: true |
77 | | - action [:enable, :start] |
78 | | - subscribes :restart, resources(template: "/etc/ceph/ceph.conf") |
79 | | -end |
80 | | - |
81 | | - |
82 | 46 | unless File.exist?("/var/lib/ceph/mon/ceph-#{mon_name}/done") |
83 | 47 | keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{mon_name}.mon.keyring" |
84 | 48 |
|
|
236 | 200 | end |
237 | 201 | end |
238 | 202 | end |
| 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 |
0 commit comments