Skip to content

Commit 32c25e2

Browse files
committed
test proper keyring creation
1 parent 0ddc433 commit 32c25e2

File tree

1 file changed

+6
-3
lines changed
  • chef/cookbooks/ceph/recipes

1 file changed

+6
-3
lines changed

chef/cookbooks/ceph/recipes/mon.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@
4646

4747

4848
unless File.exist?("/var/lib/ceph/mgr/ceph-#{mon_name}/done")
49-
keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{mon_name}.mgr.keyring"
49+
keyring = "/var/lib/ceph/mgr/#{cluster}-#{mon_name}/keyring"
5050
execute "create mgr keyring" do
51-
command "ceph-authtool '#{keyring}' --create-keyring --name=mgr. --add-key='#{node["ceph"]["monitor-secret"]}' --cap mgr 'allow *'"
52-
not_if { node["ceph"]["monitor-secret"].empty? }
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) }
5356
end
5457
ruby_block "finalise" do
5558
block do

0 commit comments

Comments
 (0)