Skip to content

Commit

Permalink
Use modern facts and IP address validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Dec 3, 2018
1 parent 1c8227b commit d4a0700
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manifests/proxydns.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d4a0700

Please sign in to comment.