style fixes

silence puppet-lint
This commit is contained in:
Michael Moll 2013-02-03 00:30:54 +01:00
parent ef73d094dc
commit 7743650cde
9 changed files with 49 additions and 42 deletions

View file

@ -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],
}
}

View file

@ -1,12 +1,14 @@
class sshd::client::base {
# this is needed because the gid might have changed
file { '/etc/ssh/ssh_known_hosts':
mode => 0644, owner => root, group => 0;
mode => '0644',
owner => root,
group => 0;
}
# Now collect all server keys
case $sshd::client::shared_ip {
no: { Sshkey <<||>> }
yes: { Sshkey <<| tag == "fqdn" |>> }
yes: { Sshkey <<| tag == fqdn |>> }
}
}

View file

@ -8,14 +8,14 @@ class sshd::debian inherits sshd::linux {
}
$sshd_restartandstatus = $::lsbdistcodename ? {
etch => false,
etch => false,
default => true
}
Service[sshd]{
name => 'ssh',
pattern => 'sshd',
hasstatus => $sshd_restartandstatus,
name => 'ssh',
pattern => 'sshd',
hasstatus => $sshd_restartandstatus,
hasrestart => $sshd_restartandstatus,
}
}

View file

@ -37,8 +37,8 @@ class sshd(
) {
class{'sshd::client':
shared_ip => $sshd::shared_ip,
ensure_version => $sshd::ensure_version,
shared_ip => $sshd::shared_ip,
ensure_version => $sshd::ensure_version,
manage_shorewall => $manage_shorewall,
}
@ -58,7 +58,7 @@ class sshd(
if $manage_shorewall {
class{'shorewall::rules::ssh':
ports => $ports,
ports => $ports,
source => $shorewall_source
}
}

View file

@ -1,5 +1,5 @@
class sshd::linux inherits sshd::base {
package{openssh:
package{'openssh':
ensure => $sshd::ensure_version,
}
File[sshd_config]{

View file

@ -5,18 +5,18 @@ define sshd::nagios(
) {
$real_port = $port ? {
'absent' => $name,
default => $port,
default => $port,
}
case $check_hostname {
'absent': {
nagios::service{"ssh_port_${name}":
ensure => $ensure,
ensure => $ensure,
check_command => "check_ssh_port!${real_port}"
}
}
default: {
nagios::service{"ssh_port_host_${name}":
ensure => $ensure,
ensure => $ensure,
check_command => "check_ssh_port_host!${real_port}!${check_hostname}"
}
}

View file

@ -1,8 +1,8 @@
class sshd::openbsd inherits sshd::base {
Service[sshd]{
restart => '/bin/kill -HUP `/bin/cat /var/run/sshd.pid`',
stop => '/bin/kill `/bin/cat /var/run/sshd.pid`',
start => '/usr/sbin/sshd',
restart => '/bin/kill -HUP `/bin/cat /var/run/sshd.pid`',
stop => '/bin/kill `/bin/cat /var/run/sshd.pid`',
start => '/usr/sbin/sshd',
hasstatus => false,
}
}

View file

@ -1,5 +1,5 @@
class sshd::redhat inherits sshd::linux {
Package[openssh]{
name => 'openssh-server',
}
class sshd::redhat inherits sshd::linux {
Package[openssh]{
name => 'openssh-server',
}
}

View file

@ -13,8 +13,8 @@ define sshd::ssh_authorized_key(
}
$real_user = $user ? {
false => $name,
'' => $name,
false => $name,
'' => $name,
default => $user,
}
@ -31,14 +31,14 @@ define sshd::ssh_authorized_key(
}
ssh_authorized_key{$name:
ensure => $ensure,
type => $type,
key => $key,
user => $real_user,
type => $type,
key => $key,
user => $real_user,
target => $real_target,
}
case $options {
'absent': { info("not setting any option for ssh_authorized_key: $name") }
'absent': { info("not setting any option for ssh_authorized_key: ${name}") }
default: {
Ssh_authorized_key[$name]{
options => $options,