diff options
Diffstat (limited to 'lib/puppet/type/ssh_authorized_key.rb')
-rw-r--r-- | lib/puppet/type/ssh_authorized_key.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb index 66cf3e733..997afb81e 100644 --- a/lib/puppet/type/ssh_authorized_key.rb +++ b/lib/puppet/type/ssh_authorized_key.rb @@ -31,6 +31,20 @@ module Puppet newproperty(:target) do desc "The file in which to store the SSH key." + + defaultto :absent + + def should + if defined? @should and @should[0] != :absent + return super + end + + if user = resource[:user] + return File.expand_path("~%s/.ssh/authorized_keys" % user) + end + + return nil + end end newproperty(:options, :array_matching => :all) do |