summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-14 19:34:47 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-14 19:45:16 +0100
commit5233b23c97da750f632ae62162e434b58ee80da9 (patch)
treeb08aa87756c585f8e8429574c94e9b4782ce7f9f
parentUse module dns_record. (diff)
downloadprofiles-5233b23c97da750f632ae62162e434b58ee80da9.tar.gz
profiles-5233b23c97da750f632ae62162e434b58ee80da9.tar.xz
Add automatic reverse zone.
-rw-r--r--manifests/dns_zones.pp8
-rw-r--r--manifests/publish_dns.pp12
2 files changed, 19 insertions, 1 deletions
diff --git a/manifests/dns_zones.pp b/manifests/dns_zones.pp
index a6f7fdd..9204ad2 100644
--- a/manifests/dns_zones.pp
+++ b/manifests/dns_zones.pp
@@ -17,7 +17,10 @@ class profiles::dns_zones (
create_resources(dns::zone, $zones, $default)
- $rev_zone = dns::reverse_dns($facts['networking']['network6'])[32,-1]
+ [$_, $rev_zone] = dns_record::rev_record(
+ $facts['networking']['ip6'],
+ $facts['networking']['netmask6'])
+
dns::zone { $rev_zone:
reverse => true,
target_views => [
@@ -26,6 +29,7 @@ class profiles::dns_zones (
}
Dns_record <<| zone == 'adrift.space' |>>
+ Dns_record <<| zone == $rev_zone |>>
$zone_hash = Hash(lookup('dns_zones."adrift.space"').map |$d| {
["adrift.space ${d['type']} ${d['key']} ${d['value']}", $d]
@@ -37,6 +41,8 @@ class profiles::dns_zones (
'notify' => Dns_zone['adrift.space'],
})
+
+
dns_zone { 'adrift.space':
# default_ttl => '300',
primary => 'ns1.adrift.space.',
diff --git a/manifests/publish_dns.pp b/manifests/publish_dns.pp
index bf5aa81..40860fa 100644
--- a/manifests/publish_dns.pp
+++ b/manifests/publish_dns.pp
@@ -8,4 +8,16 @@ class profiles::publish_dns (
value => $facts['ipaddress6'],
}
+
+ [$record, $zone] = dns_record::rev_record(
+ $facts['networking']['ip6'],
+ $facts['networking']['netmask6'])
+
+ @@dns_record { "PTR automatic ${::fqdn}":
+ type => 'PTR',
+ zone => $zone,
+ key => $record,
+ value => $::fqdn,
+ }
+
}