neoloc/loopback_dns (#281)

- 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
This commit was merged in pull request #281.
This commit is contained in:
2025-05-11 16:36:04 +10:00
parent 3e0141bb1b
commit 87a6c73578
14 changed files with 67 additions and 37 deletions
+20 -1
View File
@@ -7,6 +7,7 @@ class profiles::dns::base (
'region',
'country'
]] $use_ns = undef,
String $primary_interface = $facts['networking']['primary'],
Optional[String] $ns_role = undef,
){
@@ -43,6 +44,24 @@ class profiles::dns::base (
}
# export dns records for client
profiles::dns::client {"${facts['networking']['fqdn']}-default":}
$facts['networking']['interfaces'].each | $interface, $data | {
# exclude those without ipv4 address, lo and anycast addresses
if $data['ip'] and $interface != 'lo' and $interface !~ /^anycast[0-9]$/ {
# use defaults for the primary_interface
if $interface == $primary_interface {
profiles::dns::client {"${facts['networking']['fqdn']}-${interface}":
interface => $interface,
}
# update secondary interfaces
}else{
profiles::dns::client {"${facts['networking']['fqdn']}-${interface}":
interface => $interface,
hostname => "${facts['networking']['hostname']}-${interface}",
}
}
}
}
}