Merge branch 'disable_stored_config' into 'master'
[feat] Optinally disable exported resources If run masterless, we cannot export resources, so we move them to an own class. Including it can be disabled by passing "use_storedconfig" to the sshd class. See merge request !21
This commit is contained in:
commit
c2fd1a769e
3 changed files with 26 additions and 16 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 ::ssh::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,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue