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
This commit is contained in:
2023-11-11 23:00:55 +11:00
parent 1ff4611318
commit 76b54fc59d
13 changed files with 231 additions and 2 deletions
+34
View File
@@ -0,0 +1,34 @@
# 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',
}
}
}