From: Walter Huf Date: Fri, 14 Mar 2014 15:29:31 +0000 (-0500) Subject: Adds the option of setting the key file's ownership X-Git-Tag: v0.8.0~52^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61ef3d7f2a1a8993bef2cce5474b7eec69542e52;p=ceph-cookbooks.git Adds the option of setting the key file's ownership --- diff --git a/providers/client.rb b/providers/client.rb index 7d01c20..98bf333 100644 --- a/providers/client.rb +++ b/providers/client.rb @@ -9,6 +9,9 @@ action :add do filename = @current_resource.filename keyname = @current_resource.keyname caps = @new_resource.caps.map { |k, v| "#{k} '#{v}'" }.join(' ') + owner = @new_resource.owner + group = @new_resource.group + mode = @new_resource.mode if ! @current_resource.caps_match converge_by("Set caps for #{@new_resource}") do auth_set_key(keyname, caps) @@ -17,18 +20,18 @@ action :add do # update the key in the file file filename do content file_content - owner 'root' - group 'root' - mode '640' + owner owner + group group + mode mode end end else # make sure the file matches what the cluster thinks file filename do content file_content - owner 'root' - group 'root' - mode '640' + owner owner + group group + mode mode end end diff --git a/resources/client.rb b/resources/client.rb index e8af62a..023e6c2 100644 --- a/resources/client.rb +++ b/resources/client.rb @@ -16,4 +16,9 @@ attribute :keyname, :kind_of => String # defaults to /etc/ceph/ceph.client.#{name}.#{hostname}.secret if not as_keyring attribute :filename, :kind_of => String +# key file access creds +attribute :owner, :kind_of => String, :default => 'root' +attribute :group, :kind_of => String, :default => 'root' +attribute :mode, :kind_of => Integer, :default => 00640 + attr_accessor :key, :caps_match