diff --git a/recipes/mds.rb b/recipes/mds.rb index 658de9d..699c938 100644 --- a/recipes/mds.rb +++ b/recipes/mds.rb @@ -30,15 +30,10 @@ action :create end -ruby_block 'create mds client key' do - block do - cmd = "ceph auth get-or-create mds.#{node['hostname']} osd 'allow *' mon 'allow rwx' --name mon. --key='#{node["ceph"]["monitor-secret"]}'" - keyring = Mixlib::ShellOut.new(cmd).run_command.stdout - - keyfile = File.new("/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/keyring", 'w') - keyfile.puts(keyring) - keyfile.close - end +ceph_client 'mds' do + caps('osd' => 'allow *', 'mon' => 'allow rwx') + keyname "mds.#{node['hostname']}" + filename "/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/keyring" end file "/var/lib/ceph/mds/#{cluster}-#{node["hostname"]}/done" do