remove .onion from configured address for onionbalance
[mirror/dsa-puppet.git] / modules / onion / manifests / service.pp
index 726f6c8..08b892a 100644 (file)
@@ -13,9 +13,10 @@ define onion::service (
 
        $onion_hn = onion_hostname($name)
        if $onion_hn {
+               $hostname_without_onion = regsubst($onion_hn, '\.onion$', '')
                @@concat::fragment { "onion::balance::instance::$name::$fqdn":
                        target  => "/etc/onionbalance/config.yaml",
-                       content => "      - address: ${onion_hn}\n        name: ${hostname}-${name}\n",
+                       content => "      - address: ${hostname_without_onion}\n        name: ${hostname}-${name}\n",
                        order   => "50-${name}-20",
                        tag     => "onion::balance::$name",
                }