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
This commit is contained in:
@@ -1,34 +1,31 @@
|
||||
# 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,
|
||||
Integer $order = 10,
|
||||
){
|
||||
|
||||
$intf = $facts['networking']['primary']
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
$last_octet = regsubst($::facts['networking']['ip'], '^.*\.', '')
|
||||
|
||||
if $forward {
|
||||
@@resource_record { "${fqdn}_${intf}-a":
|
||||
ensure => present,
|
||||
record => $::facts['networking']['fqdn'],
|
||||
profiles::dns::record { "${fqdn}_${intf}_A":
|
||||
value => $::facts['networking']['ip'],
|
||||
type => 'A',
|
||||
data => [$::facts['networking']['ip']],
|
||||
ttl => $ttl,
|
||||
zone => "${::facts['networking']['domain']}-master",
|
||||
tag => 'master-a-record',
|
||||
record => $::facts['networking']['hostname'],
|
||||
zone => $::facts['networking']['domain'],
|
||||
order => $order,
|
||||
}
|
||||
}
|
||||
|
||||
if $reverse {
|
||||
@@resource_record { "${fqdn}_${addr}-ptr":
|
||||
ensure => present,
|
||||
record => $::facts['arpa'][$intf]['addr'],
|
||||
profiles::dns::record { "${fqdn}_${intf}_PTR":
|
||||
value => "${::facts['networking']['fqdn']}.",
|
||||
type => 'PTR',
|
||||
data => [$fqdn],
|
||||
ttl => $ttl,
|
||||
zone => "${::facts['arpa'][$intf]['zone']}-master",
|
||||
tag => 'master-ptr-record',
|
||||
record => $last_octet,
|
||||
zone => $::facts['arpa'][$intf]['zone'],
|
||||
order => $order,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user