]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
custom ip address fact
authorTomas Barton <barton.tomas@gmail.com>
Fri, 14 Feb 2014 00:24:15 +0000 (01:24 +0100)
committerTomas Barton <barton.tomas@gmail.com>
Fri, 14 Feb 2014 00:24:15 +0000 (01:24 +0100)
manifests/base.pp
manifests/init.pp

index a0f1872f47086d32e7b99c2c5f1bdfdf59a17705..a7a61a6c5c8f1fe8c67e0d514e775f573e07b3af 100644 (file)
@@ -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,
index fb76438a70fe2641747e23bd7386d96d7d8522f9..927bbc61868a85362ac0d4e3acf67aa30d374671 100644 (file)
@@ -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)