diff options
author | Tomas Barton <barton.tomas@gmail.com> | 2014-02-14 01:24:15 +0100 |
---|---|---|
committer | Tomas Barton <barton.tomas@gmail.com> | 2014-02-14 01:24:15 +0100 |
commit | a6a05cd9fc019db127e18898b3ab3e624644a8b5 (patch) | |
tree | 2fd835132f9d5f33d80459d4eaaaa4d8039ae6f0 /manifests | |
parent | 253e4f1ceddb8666281c207bb41af1e8a167ee0d (diff) | |
download | puppet-sshd-a6a05cd9fc019db127e18898b3ab3e624644a8b5.tar.gz puppet-sshd-a6a05cd9fc019db127e18898b3ab3e624644a8b5.tar.bz2 |
custom ip address fact
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/base.pp | 8 | ||||
-rw-r--r-- | manifests/init.pp | 3 |
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) |