This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Brice Figureau (author)
Tue Nov 11 04:43:29 -0800 2008
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 1 | module Puppet | |
| 2 | newtype(:ssh_authorized_key) do | ||||
| 5268487a » | ctrlaltdel | 2008-09-27 | 3 | @doc = "Manages SSH authorized keys. Currently only type 2 keys are | |
| 4 | supported." | ||||
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 5 | ||
| 6 | ensurable | ||||
| 7 | |||||
| 8 | newparam(:name) do | ||||
| 731d0f22 » | jamtur01 | 2008-07-02 | 9 | desc "The SSH key comment." | |
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 10 | ||
| 11 | isnamevar | ||||
| 12 | end | ||||
| 13 | |||||
| 14 | newproperty(:type) do | ||||
| 5268487a » | ctrlaltdel | 2008-09-27 | 15 | desc "The encryption type used: ssh-dss or ssh-rsa." | |
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 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 | 29 | desc "The user account in which the SSH key should be installed." | |
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 30 | end | |
| 31 | |||||
| 32 | newproperty(:target) do | ||||
| 731d0f22 » | jamtur01 | 2008-07-02 | 33 | desc "The file in which to store the SSH key." | |
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 34 | end | |
| 35 | |||||
| 36 | newproperty(:options, :array_matching => :all) do | ||||
| 731d0f22 » | jamtur01 | 2008-07-02 | 37 | desc "Key options, see sshd(8) for possible values. Multiple values | |
| 38 | should be specified as an array." | ||||
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 39 | ||
| 40 | defaultto do :absent end | ||||
| bf5be00f » | Brice Figureau | 2008-11-11 | 41 | ||
| 42 | def is_to_s(value) | ||||
| 43 | if value == :absent or value.include?(:absent) | ||||
| 44 | super | ||||
| 45 | else | ||||
| 46 | value.join(",") | ||||
| 47 | end | ||||
| 48 | end | ||||
| 49 | |||||
| 50 | def should_to_s(value) | ||||
| 51 | if value == :absent or value.include?(:absent) | ||||
| 52 | super | ||||
| 53 | else | ||||
| 54 | value.join(",") | ||||
| 55 | end | ||||
| 56 | end | ||||
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 57 | end | |
| 8c5c949b » | ctrlaltdel | 2008-06-27 | 58 | ||
| 59 | autorequire(:user) do | ||||
| 60 | if should(:user) | ||||
| 61 | should(:user) | ||||
| 62 | end | ||||
| 63 | end | ||||
| 64 | |||||
| 65 | validate do | ||||
| 4c5293b8 » | ctrlaltdel | 2008-07-11 | 66 | unless should(:target) or should(:user) | |
| 8c5c949b » | ctrlaltdel | 2008-06-27 | 67 | raise Puppet::Error, "Attribute 'user' or 'target' is mandatory" | |
| 68 | end | ||||
| 69 | end | ||||
| db8a46c6 » | ctrlaltdel | 2008-04-10 | 70 | end | |
| 71 | end | ||||
| 72 | |||||








