aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-02-17 19:46:11 +0000
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-02-17 19:46:11 +0000
commit86b9637755c2aa540a5e1bada32c8181a67acca8 (patch)
treefcec163f93ac0fc54ad4e38d3ab591f9d8ef234a /manifests/init.pp
parentd6c091a54108efaa59e97ac89761e6bbc89f7cc1 (diff)
downloadpuppet-sshd-86b9637755c2aa540a5e1bada32c8181a67acca8.tar.gz
puppet-sshd-86b9637755c2aa540a5e1bada32c8181a67acca8.tar.bz2
first step to put ssh and sshd together
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@820 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp43
1 files changed, 42 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 07edc2a..1fc043f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -46,13 +46,17 @@ class sshd {
define sshd::sshd_config (
$source = "",
- $allowed_users = 'root'
){
$real_source = $source ? {
'' => "${operatingsystem}_normal.erb",
default => $source,
}
+ $real_allowed_users = ? $sshd_allowed_users ? {
+ '' => 'root',
+ default => $sshd_allowed_users,
+ }
+
file { 'sshd_config':
path => '/etc/ssh/sshd_config',
owner => root,
@@ -65,3 +69,40 @@ define sshd::sshd_config (
},
}
}
+
+define sshd::deploy_auth_key(
+ $source => '',
+ $user = 'root',
+ $target_dir = '/root/.ssh/',
+ $group = '' ) {
+
+ $real_target = $target_dir ? {
+ '' => "/home/$user/.ssh/",
+ default => $target_dir,
+ }
+
+ $real_group = $group ? {
+ '' => 0,
+ default => $group,
+ }
+
+ $real_source = $source ? {
+ '' => "sshd/authorized_keys/${name}",
+ default => $source,
+ }
+
+ file {$real_target:
+ ensure => directory,
+ owner => $user,
+ group => $real_group,
+ mode => 700,
+ }
+
+ file {"authorized_keys_${user}":
+ path => "$real_target/authorized_keys",
+ owner => $user,
+ group => $real_group,
+ mode => 600,
+ source => "puppet://$server/$source",
+ }
+}