feat: add unkin.net domain

- manage the unkin.net domain
- ensure forwarding for unkin.net
- split domain from cname list and set zone correctly
- add fafflix to cnames list for haproxy2
This commit is contained in:
2025-07-06 18:49:23 +10:00
parent 2814a55df6
commit 554d24a0cd
8 changed files with 63 additions and 15 deletions
+27 -6
View File
@@ -26,6 +26,18 @@ class profiles::dns::master (
}
}
# create a hash of hostname => ip, which will be used to create glue records
$glue_records_map = $ns_role ? {
undef => {
$facts['networking']['fqdn'] => $facts['networking']['ip']
},
default => $nameservers_array.reduce({}) |$acc, $fqdn| {
$result = query_nodes("networking.fqdn='${fqdn}'", 'networking.ip')
$ip = $result[0]
$acc + { "${fqdn}." => $ip }
}
}
# if nameservers is empty, use the current host, otherwise use nameservers_array as nameservers
$nameservers = empty($nameservers_array) ? {
true => [$facts['networking']['fqdn']],
@@ -51,14 +63,23 @@ class profiles::dns::master (
# create zones
$zones.each | String $name, Hash $data | {
# only add glue records when the domain isnt reverse dns, or main.unkin.net
# - since the hosts will already be in main.unkin.net
if $data['zone_type'] == 'master' {
$glue_records = $data['domain'] ? {
/in-addr\.arpa$/ => undef,
'main.unkin.net' => undef,
default => $glue_records_map,
}
profiles::dns::zone { $name:
zone => $data['domain'],
basedir => $basedir,
nameservers => sort($nameservers),
owner => $owner,
group => $group,
before => Bind::Zone[$name]
zone => $data['domain'],
basedir => $basedir,
nameservers => sort($nameservers),
owner => $owner,
group => $group,
before => Bind::Zone[$name],
glue_records => $glue_records,
}
}
}
+1
View File
@@ -5,6 +5,7 @@ define profiles::dns::zone (
Stdlib::AbsolutePath $basedir,
String $owner,
String $group,
Optional[Hash[String, String]] $glue_records = {},
) {
# Define the concat resource for the zone file