aboutsummaryrefslogtreecommitdiff
path: root/manifests/base.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-02-04 21:41:05 +0100
committermh <mh@immerda.ch>2013-02-04 21:41:05 +0100
commit8ecac4219f3d5975fba20316c7d469153d2ca4fc (patch)
tree8fce6dd7c40bb1cfe8ad5996e382538cbf606427 /manifests/base.pp
parent576bbf09d8516809d7373dc9b4e725ce2151a463 (diff)
parentad6ecdffe7d8267d1bfa74ece164ee1129ca8d26 (diff)
downloadpuppet-sshd-8ecac4219f3d5975fba20316c7d469153d2ca4fc.tar.gz
puppet-sshd-8ecac4219f3d5975fba20316c7d469153d2ca4fc.tar.bz2
Merge remote-tracking branch 'githubmirror/master'
Diffstat (limited to 'manifests/base.pp')
-rw-r--r--manifests/base.pp37
1 files changed, 21 insertions, 16 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 4001985..ef066e0 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,12 +1,17 @@
class sshd::base {
+
+ $sshd_config_content = $::lsbdistcodename ? {
+ '' => template("sshd/sshd_config/${::operatingsystem}.erb"),
+ default => template ("sshd/sshd_config/${::operatingsystem}_${::lsbdistcodename}.erb"),
+ }
+
file { 'sshd_config':
- path => '/etc/ssh/sshd_config',
- content => $::lsbdistcodename ? {
- '' => template("sshd/sshd_config/${::operatingsystem}.erb"),
- default => template ("sshd/sshd_config/${::operatingsystem}_${::lsbdistcodename}.erb"),
- },
- notify => Service[sshd],
- owner => root, group => 0, mode => 600;
+ path => '/etc/ssh/sshd_config',
+ content => $sshd_config_content,
+ notify => Service[sshd],
+ owner => root,
+ group => 0,
+ mode => '0600';
}
# Now add the key, if we've got one
@@ -14,28 +19,28 @@ class sshd::base {
'': { info("no sshrsakey on ${::fqdn}") }
default: {
@@sshkey{$::fqdn:
- tag => "fqdn",
+ ensure => present,
+ tag => 'fqdn',
type => ssh-rsa,
key => $::sshrsakey,
- ensure => present,
}
# In case the node has uses a shared network address,
# we don't define a sshkey resource using an IP address
- if $sshd::shared_ip == "no" {
+ if $sshd::shared_ip == 'no' {
@@sshkey{$::ipaddress:
- tag => "ipaddress",
+ ensure => present,
+ tag => 'ipaddress',
type => ssh-rsa,
key => $::sshrsakey,
- ensure => present,
}
}
}
}
service{'sshd':
- name => 'sshd',
- enable => true,
- ensure => running,
+ ensure => running,
+ name => 'sshd',
+ enable => true,
hasstatus => true,
- require => File[sshd_config],
+ require => File[sshd_config],
}
}