puppet-prod/site/profiles/manifests/dns/client.pp
Ben Vincent 76b54fc59d feat: add dns resolver/master classes
- define resolver and master dns server
- export A and PTR records from dns clients
- collect exported resources for master
- create hiera structure for acls, zones and views
2023-11-13 21:42:57 +11:00

35 lines
941 B
Puppet

# profiles::dns::client
define profiles::dns::client (
Integer $ttl = 600,
String $intf = $facts['networking']['primary'],
String $addr = $facts['networking']['ip'],
String $fqdn = $facts['networking']['fqdn'],
Boolean $forward = true,
Boolean $reverse = true,
){
if $forward {
@@resource_record { "${fqdn}_${intf}-a":
ensure => present,
record => $::facts['networking']['fqdn'],
type => 'A',
data => [$::facts['networking']['ip']],
ttl => $ttl,
zone => "${::facts['networking']['domain']}-master",
tag => 'master-a-record',
}
}
if $reverse {
@@resource_record { "${fqdn}_${addr}-ptr":
ensure => present,
record => $::facts['arpa'][$intf]['addr'],
type => 'PTR',
data => [$fqdn],
ttl => $ttl,
zone => "${::facts['arpa'][$intf]['zone']}-master",
tag => 'master-ptr-record',
}
}
}