puppet-prod/site/profiles/manifests/dns/client.pp
Ben Vincent c996c9b7e3 fix: enable dynamic/tsig updates
- add eyaml to hiera.yaml
- consolidate all paths into single tree
- change to new profiles::dns::client wrapper
- change to new profiles::dns::record wrapper
- change to use concat method to build zone file
2023-11-16 21:40:16 +11:00

32 lines
820 B
Puppet

# profiles::dns::client
define profiles::dns::client (
Boolean $forward = true,
Boolean $reverse = true,
Integer $order = 10,
){
$intf = $facts['networking']['primary']
$fqdn = $facts['networking']['fqdn']
$last_octet = regsubst($::facts['networking']['ip'], '^.*\.', '')
if $forward {
profiles::dns::record { "${fqdn}_${intf}_A":
value => $::facts['networking']['ip'],
type => 'A',
record => $::facts['networking']['hostname'],
zone => $::facts['networking']['domain'],
order => $order,
}
}
if $reverse {
profiles::dns::record { "${fqdn}_${intf}_PTR":
value => "${::facts['networking']['fqdn']}.",
type => 'PTR',
record => $last_octet,
zone => $::facts['arpa'][$intf]['zone'],
order => $order,
}
}
}