lak / puppet

Server automation framework and application

This URL has Read+Write access

puppet / lib / puppet / type / ssh_authorized_key.rb
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 1 module Puppet
2 newtype(:ssh_authorized_key) do
5268487a » ctrlaltdel 2008-09-27 Fixed documentation, typo a... 3 @doc = "Manages SSH authorized keys. Currently only type 2 keys are
4 supported."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 5
6 ensurable
7
8 newparam(:name) do
731d0f22 » jamtur01 2008-07-02 Minor documentation updates... 9 desc "The SSH key comment."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 10
11 isnamevar
12 end
13
14 newproperty(:type) do
5268487a » ctrlaltdel 2008-09-27 Fixed documentation, typo a... 15 desc "The encryption type used: ssh-dss or ssh-rsa."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 16
17 newvalue("ssh-dss")
18 newvalue("ssh-rsa")
19
20 aliasvalue(:dsa, "ssh-dss")
21 aliasvalue(:rsa, "ssh-rsa")
22 end
23
24 newproperty(:key) do
25 desc "The key itself; generally a long string of hex digits."
26 end
27
28 newproperty(:user) do
731d0f22 » jamtur01 2008-07-02 Minor documentation updates... 29 desc "The user account in which the SSH key should be installed."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 30 end
31
32 newproperty(:target) do
731d0f22 » jamtur01 2008-07-02 Minor documentation updates... 33 desc "The file in which to store the SSH key."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 34 end
35
36 newproperty(:options, :array_matching => :all) do
731d0f22 » jamtur01 2008-07-02 Minor documentation updates... 37 desc "Key options, see sshd(8) for possible values. Multiple values
38 should be specified as an array."
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 39
40 defaultto do :absent end
41 end
8c5c949b » ctrlaltdel 2008-06-27 ssh_authorized_key: autoreq... 42
43 autorequire(:user) do
44 if should(:user)
45 should(:user)
46 end
47 end
48
49 validate do
4c5293b8 » ctrlaltdel 2008-07-11 Fix #1409, Move path expans... 50 unless should(:target) or should(:user)
8c5c949b » ctrlaltdel 2008-06-27 ssh_authorized_key: autoreq... 51 raise Puppet::Error, "Attribute 'user' or 'target' is mandatory"
52 end
53 end
db8a46c6 » ctrlaltdel 2008-04-10 New native ssh_authorized_k... 54 end
55 end
56