Use .dig to dig into hiera structs
authorTollef Fog Heen <tfheen@err.no>
Fri, 2 Feb 2018 09:57:12 +0000 (10:57 +0100)
committerTollef Fog Heen <tfheen@err.no>
Fri, 2 Feb 2018 09:57:12 +0000 (10:57 +0100)
modules/roles/manifests/security_mirror.pp

index 0972418..c0b4447 100644 (file)
@@ -58,8 +58,8 @@ class roles::security_mirror {
                binds       => $binds,
        }
 
-       $onion_v4_addr = hiera("roles.security_mirror.${::fqdn}.onion_v4_address", undef)
-       notify { "Onion address: ${onion_v4_address}": }
+       $onion_v4_addr = hiera("roles.security_mirror", {})
+               .dig($::fqdn, 'onion_v4_address')
        if $onion_v4_addr {
                onion::service { 'security.debian.org':
                        port => 80,