- manage all interfaces in dns (except lo and anycast) - move loopback0 anycast addresses to be anycast0 Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/281
33 lines
913 B
Puppet
33 lines
913 B
Puppet
# profiles::dns::client
|
|
define profiles::dns::client (
|
|
Boolean $forward = true,
|
|
Boolean $reverse = true,
|
|
Integer $order = 10,
|
|
String $interface = $facts['networking']['primary'],
|
|
Stdlib::Fqdn $hostname = $facts['networking']['hostname'],
|
|
Stdlib::Fqdn $domain = $facts['networking']['domain'],
|
|
){
|
|
|
|
$last_octet = regsubst($facts['networking']['interfaces'][$interface]['ip'], '^.*\.', '')
|
|
|
|
if $forward {
|
|
profiles::dns::record { "${title}_A":
|
|
value => $facts['networking']['interfaces'][$interface]['ip'],
|
|
type => 'A',
|
|
record => $hostname,
|
|
zone => $domain,
|
|
order => $order,
|
|
}
|
|
}
|
|
|
|
if $reverse {
|
|
profiles::dns::record { "${title}_PTR":
|
|
value => "${hostname}.${domain}.",
|
|
type => 'PTR',
|
|
record => $last_octet,
|
|
zone => $facts['arpa'][$interface]['zone'],
|
|
order => $order,
|
|
}
|
|
}
|
|
}
|