Introducing sshd_internal_ip variable

This commit is contained in:
Silvio Rhatto 2009-12-27 14:23:51 -02:00
parent bbc03d2c10
commit 1fd1d896a0
3 changed files with 19 additions and 7 deletions

View file

@ -14,14 +14,20 @@ class sshd::base {
'': { info("no sshrsakey on $fqdn") }
default: {
@@sshkey{"$hostname.$domain":
type => ssh-rsa,
key => $sshrsakey_key,
tag => "fqdn",
type => ssh-rsa,
key => $sshrsakey_key,
ensure => present,
}
@@sshkey{"$ipaddress":
type => ssh-rsa,
key => $sshrsakey,
ensure => present,
# In case the node has an internal network address,
# we don't define a sshkey resource using an IP address
if $sshd_internal_ip == "no" {
@@sshkey{"$ipaddress":
tag => "ipaddress",
type => ssh-rsa,
key => $sshrsakey,
ensure => present,
}
}
}
}

View file

@ -5,5 +5,8 @@ class sshd::client::base {
}
# Now collect all server keys
Sshkey <<||>>
case $sshd_internal_ip {
no: { Sshkey <<||>> }
yes: { Sshkey <<| tag == "fqdn" |>> }
}
}

View file

@ -214,6 +214,9 @@ class sshd {
case $sshd_print_motd {
'': { $sshd_print_motd = "yes" }
}
case $sshd_internal_ip {
'': { $sshd_internal_ip = "no" }
}
include sshd::client