aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/base.pp8
-rw-r--r--manifests/init.pp3
2 files changed, 8 insertions, 3 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index a0f1872..a7a61a6 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,4 +1,6 @@
-class sshd::base {
+class sshd::base(
+ $ipaddres_fact = $sshd::ipaddres_fact,
+) {
$sshd_config_content = $::lsbdistcodename ? {
'' => template("sshd/sshd_config/${::operatingsystem}.erb"),
@@ -27,8 +29,10 @@ class sshd::base {
}
# In case the node has uses a shared network address,
# we don't define a sshkey resource using an IP address
+ $ipaddr = inline_template("<%= scope.lookupvar(ipaddr_fact) %>")
if $sshd::shared_ip == 'no' {
- @@sshkey{$::ipaddress:
+ @@sshkey{$ipaddr:
+
ensure => present,
tag => 'ipaddress',
type => ssh-rsa,
diff --git a/manifests/init.pp b/manifests/init.pp
index fb76438..927bbc6 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -33,7 +33,8 @@ class sshd(
$tail_additional_options = '',
$print_motd = 'yes',
$manage_shorewall = false,
- $shorewall_source = 'net'
+ $shorewall_source = 'net',
+ $ipaddres_fact = 'ipaddress',
) {
validate_bool($manage_shorewall)