diff --git a/manifests/proxydns.pp b/manifests/proxydns.pp index 3eea98904..b1e313d18 100644 --- a/manifests/proxydns.pp +++ b/manifests/proxydns.pp @@ -35,10 +35,10 @@ # puppet fact names are converted from ethX.X and ethX:X to ethX_X # so for alias and vlan interfaces we have to modify the name accordingly $interface_fact_name = regsubst($interface, '[.:]', '_') - $ip = getvar("::ipaddress_${interface_fact_name}") + $ip = fact("ipaddress_${interface_fact_name}") - unless is_ip_address($ip) { - fail("Could not get the ip address from fact ipaddress_${interface_fact_name}") + assert_type(Stdlib::Compat::Ipv4, $ip) |$expected, $actual| { + fail("Could not get a valid IP address from fact ipaddress_${interface_fact_name}: '${ip}' (${actual})") } if $reverse_zone {