ports/static mirror: if listen_addr are not explicitly set, use the host's public...
[mirror/dsa-puppet.git] / modules / roles / manifests / static_mirror_web.pp
index 72f4815..5847252 100644 (file)
@@ -142,7 +142,10 @@ class roles::static_mirror_web(
 
 
   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?.")
     }