Compare commits
7 commits
2ae42e6633
...
1baecb9c4a
Author | SHA1 | Date | |
---|---|---|---|
1baecb9c4a | |||
85b43a2379 | |||
|
672b0985d1 | ||
|
e46479a618 | ||
|
c2fd1a769e | ||
|
fe92ce01fa | ||
|
d5f7c33df5 |
11 changed files with 41 additions and 23 deletions
|
@ -25,21 +25,9 @@ class sshd::base {
|
||||||
case $::sshrsakey {
|
case $::sshrsakey {
|
||||||
'': { info("no sshrsakey on ${::fqdn}") }
|
'': { info("no sshrsakey on ${::fqdn}") }
|
||||||
default: {
|
default: {
|
||||||
@@sshkey{$::fqdn:
|
# only export sshkey when storedconfigs is enabled
|
||||||
ensure => present,
|
if $::sshd::use_storedconfigs {
|
||||||
tag => 'fqdn',
|
include ::sshd::sshkey
|
||||||
type => ssh-rsa,
|
|
||||||
key => $::sshrsakey,
|
|
||||||
}
|
|
||||||
# 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' {
|
|
||||||
@@sshkey{$sshd::sshkey_ipaddress:
|
|
||||||
ensure => present,
|
|
||||||
tag => 'ipaddress',
|
|
||||||
type => ssh-rsa,
|
|
||||||
key => $::sshrsakey,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,16 +28,16 @@ class sshd(
|
||||||
$hostbased_authentication = 'no',
|
$hostbased_authentication = 'no',
|
||||||
$permit_empty_passwords = 'no',
|
$permit_empty_passwords = 'no',
|
||||||
$authorized_keys_file = $::osfamily ? {
|
$authorized_keys_file = $::osfamily ? {
|
||||||
Debian => $::lsbmajdistrelease ? {
|
'Debian' => $::lsbmajdistrelease ? {
|
||||||
6 => '%h/.ssh/authorized_keys',
|
6 => '%h/.ssh/authorized_keys',
|
||||||
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
||||||
},
|
},
|
||||||
RedHat => $::operatingsystemmajrelease ? {
|
'RedHat' => $::operatingsystemmajrelease ? {
|
||||||
5 => '%h/.ssh/authorized_keys',
|
5 => '%h/.ssh/authorized_keys',
|
||||||
6 => '%h/.ssh/authorized_keys',
|
6 => '%h/.ssh/authorized_keys',
|
||||||
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
||||||
},
|
},
|
||||||
OpenBSD => '%h/.ssh/authorized_keys',
|
'OpenBSD' => '%h/.ssh/authorized_keys',
|
||||||
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
|
||||||
},
|
},
|
||||||
$hardened = 'no',
|
$hardened = 'no',
|
||||||
|
@ -52,7 +52,8 @@ class sshd(
|
||||||
$hostkey_type = versioncmp($::ssh_version, '6.5') ? {
|
$hostkey_type = versioncmp($::ssh_version, '6.5') ? {
|
||||||
/(1|0)/ => [ 'rsa', 'ed25519' ],
|
/(1|0)/ => [ 'rsa', 'ed25519' ],
|
||||||
/-1/ => [ 'rsa', 'dsa' ]
|
/-1/ => [ 'rsa', 'dsa' ]
|
||||||
}
|
},
|
||||||
|
$use_storedconfigs = true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_bool($manage_shorewall)
|
validate_bool($manage_shorewall)
|
||||||
|
@ -69,10 +70,10 @@ class sshd(
|
||||||
}
|
}
|
||||||
|
|
||||||
case $::operatingsystem {
|
case $::operatingsystem {
|
||||||
gentoo: { include sshd::gentoo }
|
'gentoo': { include sshd::gentoo }
|
||||||
redhat,centos: { include sshd::redhat }
|
'redhat','centos': { include sshd::redhat }
|
||||||
openbsd: { include sshd::openbsd }
|
'openbsd': { include sshd::openbsd }
|
||||||
debian,ubuntu: { include sshd::debian }
|
'debian','ubuntu': { include sshd::debian }
|
||||||
default: { include sshd::base }
|
default: { include sshd::base }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
21
manifests/sshkey.pp
Normal file
21
manifests/sshkey.pp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# deploys the
|
||||||
|
class sshd::sshkey {
|
||||||
|
|
||||||
|
@@sshkey{$::fqdn:
|
||||||
|
ensure => present,
|
||||||
|
tag => 'fqdn',
|
||||||
|
type => 'ssh-rsa',
|
||||||
|
key => $::sshrsakey,
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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' {
|
||||||
|
@@sshkey{$::sshd::sshkey_ipaddress:
|
||||||
|
ensure => present,
|
||||||
|
tag => 'ipaddress',
|
||||||
|
type => 'ssh-rsa',
|
||||||
|
key => $::sshrsakey,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
templates/sshd_config/Ubuntu_quantal.erb
Symbolic link
1
templates/sshd_config/Ubuntu_quantal.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_raring.erb
Symbolic link
1
templates/sshd_config/Ubuntu_raring.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_saucy.erb
Symbolic link
1
templates/sshd_config/Ubuntu_saucy.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_trusty.erb
Symbolic link
1
templates/sshd_config/Ubuntu_trusty.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_utopic.erb
Symbolic link
1
templates/sshd_config/Ubuntu_utopic.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_vivid.erb
Symbolic link
1
templates/sshd_config/Ubuntu_vivid.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_wily.erb
Symbolic link
1
templates/sshd_config/Ubuntu_wily.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
1
templates/sshd_config/Ubuntu_xenial.erb
Symbolic link
1
templates/sshd_config/Ubuntu_xenial.erb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
Ubuntu.erb
|
Loading…
Reference in a new issue