ports/static mirror: if listen_addr are not explicitly set, use the host's public...
[mirror/dsa-puppet.git] / modules / roles / manifests / ports_mirror.pp
index 6b20c01..ee31374 100644 (file)
@@ -25,7 +25,10 @@ class roles::ports_mirror(
   }
 
   if $onion_service {
-    $onion_addr = filter_ipv4($listen_addr)[0]
+    $onion_addr = empty($listen_addr) ? {
+      true    => $base::public_address,
+      default => filter_ipv4($listen_addr)[0]
+    }
     if ! $onion_addr {
       fail("Do not have a useable address for the onionservice on ${::hostname}.  Is \$listen_addr empty or does it not have an IPv4 address?.")
     }