diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/client.pp | 28 | ||||
-rw-r--r-- | manifests/init.pp | 18 |
2 files changed, 44 insertions, 2 deletions
diff --git a/manifests/client.pp b/manifests/client.pp new file mode 100644 index 0000000..f0b05c5 --- /dev/null +++ b/manifests/client.pp @@ -0,0 +1,28 @@ +# manifests/client.pp + +class sshd::client { + case $operatingsystem { + debian: { include sshd::client::debian } + default: { include sshd::client::base } + } +} + +class sshd::client::base { + package {'openssh-clients': + ensure => installed, + } + + # this is needed because the gid might have changed + file { '/etc/ssh/ssh_known_hosts': + mode => 0644, owner => root, group => 0; + } + + # Now collect all server keys + Sshkey <<||>> +} + +class sshd::client::debian inherits sshd::client::base { + Package['openssh-clients']{ + name => 'openssh-client', + } +} diff --git a/manifests/init.pp b/manifests/init.pp index aa0ebfc..3b20efb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,7 @@ # Deploy authorized_keys file with the define # sshd::deploy_auth_key # -# shdd-config: +# sshd-config: # # The configuration of the sshd is rather strict and # might not fit all needs. However there are a bunch @@ -45,6 +45,8 @@ # class sshd { + include sshd::client + case $operatingsystem { gentoo: { include sshd::gentoo } redhat: { include sshd::redhat } @@ -94,7 +96,19 @@ class sshd::base { ensure => running, hasstatus => true, require => File[sshd_config], - } + } + # 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-client"], + } + } + } } class sshd::linux inherits sshd::base { |