summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-14 16:52:41 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-14 16:52:41 +0100
commit6bb92f17b6b7766598da2b3ccc984d05dd6db9f2 (patch)
treeee931861ee363ab547c33f808d4d59a6ec5b2541
parentRemove xmonad hook. (diff)
downloadprofiles-6bb92f17b6b7766598da2b3ccc984d05dd6db9f2.tar.gz
profiles-6bb92f17b6b7766598da2b3ccc984d05dd6db9f2.tar.xz
Use module dns_record.
-rw-r--r--manifests/dns_zones.pp38
-rw-r--r--manifests/publish_dns.pp11
2 files changed, 49 insertions, 0 deletions
diff --git a/manifests/dns_zones.pp b/manifests/dns_zones.pp
index 8cd4475..a6f7fdd 100644
--- a/manifests/dns_zones.pp
+++ b/manifests/dns_zones.pp
@@ -25,4 +25,42 @@ class profiles::dns_zones (
],
}
+ Dns_record <<| zone == 'adrift.space' |>>
+
+ $zone_hash = Hash(lookup('dns_zones."adrift.space"').map |$d| {
+ ["adrift.space ${d['type']} ${d['key']} ${d['value']}", $d]
+ })
+
+ create_resources(dns_record, $zone_hash, {
+ # 'ensure' => 'present',
+ 'zone' => 'adrift.space',
+ 'notify' => Dns_zone['adrift.space'],
+ })
+
+ dns_zone { 'adrift.space':
+ # default_ttl => '300',
+ primary => 'ns1.adrift.space.',
+ # email => 'domainmaster.adrift.space.',
+ # serial => $facts['zones']['adrift.space']['serial'] + 1,
+ # refresh => '2w',
+ # retry => '1d',
+ # expire => '1000h',
+ # negative_ttl => '300',
+ }
+
+ dns_record { 'remove rs1':
+ ensure => absent,
+ zone => 'adrift.space',
+ key => 'rs1'
+ }
+
+ dns_zone { 'test':
+ }
+
+ dns_record { 'Test record':
+ zone => 'test',
+ type => 'A',
+ key => 'test',
+ value => '10.20.30.40',
+ }
}
diff --git a/manifests/publish_dns.pp b/manifests/publish_dns.pp
new file mode 100644
index 0000000..bf5aa81
--- /dev/null
+++ b/manifests/publish_dns.pp
@@ -0,0 +1,11 @@
+class profiles::publish_dns (
+) {
+
+ @@dns_record { "AAAA automatic ${::fqdn}":
+ type => 'AAAA',
+ zone => $facts['domain'],
+ key => $facts['hostname'],
+ value => $facts['ipaddress6'],
+ }
+
+}