aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-07-29 23:30:05 +0000
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-07-29 23:30:05 +0000
commite41d117247df43562e18df255f31e707edcac01a (patch)
tree254b1fda147235ff80ce4fa3f63a25908388dac6 /manifests/init.pp
parent34bcb5c3d607d580a19ccba06fe43b6d02a8eb00 (diff)
downloadpuppet-sshd-e41d117247df43562e18df255f31e707edcac01a.tar.gz
puppet-sshd-e41d117247df43562e18df255f31e707edcac01a.tar.bz2
Merge commit 'puzzle/development'
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@2092 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp40
1 files changed, 40 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 569b234..7b14e8b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -90,6 +90,18 @@ class sshd::base {
content => template("sshd/sshd_config/${operatingsystem}_normal.erb"),
notify => Service[sshd],
}
+ # Now add the key, if we've got one
+ case $sshrsakey_key {
+ '': { info("no sshrsakey on $fqdn") }
+ default: {
+ @@sshkey{"$hostname.$domain":
+ type => ssh-rsa,
+ key => $sshrsakey_key,
+ ensure => present,
+ require => Package["openssh-clients"],
+ }
+ }
+ }
service{'sshd':
name => 'sshd',
enable => true,
@@ -154,12 +166,40 @@ class sshd::openbsd inherits sshd::base {
}
### defines
+# wrapper to have some defaults.
+define sshd::ssh_authorized_key(
+ $type = 'ssh-dss',
+ $key,
+ $user = 'root',
+ $target = undef,
+ $options = 'absent'
+){
+ ssh_authorized_key{$name:
+ type => $type,
+ key => $key,
+ user => $root,
+ target => $target,
+ }
+
+ case $options {
+ 'absent': { info("not setting any option for ssh_authorized_key: $name") }
+ default: {
+ Ssh_authorized_key[$name]{
+ options => $options,
+ }
+ }
+ }
+}
+
+# deprecated!
define sshd::deploy_auth_key(
$source = 'present',
$user = 'root',
$target_dir = '/root/.ssh/',
$group = 0 ) {
+ notice("this way of deploying authorized keys is deprecated. use the native ssh_authorized_key instead")
+
$real_target = $target_dir ? {
'' => "/home/$user/.ssh/",
default => $target_dir,