From 293adf31163ba4268c3dfb2697a9e8beadb4fd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 27 Feb 2022 23:05:26 +0100 Subject: Made dns_record autoreport more forgiving. --- manifests/publish_dns.pp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'manifests') diff --git a/manifests/publish_dns.pp b/manifests/publish_dns.pp index 5179317..df10854 100644 --- a/manifests/publish_dns.pp +++ b/manifests/publish_dns.pp @@ -1,23 +1,26 @@ class profiles::publish_dns ( ) { - @@dns_record { "AAAA automatic ${::fqdn}": - type => 'AAAA', - zone => $facts['domain'], - key => $facts['hostname'], - value => $facts['ipaddress6'], - } + if fact('ipaddress6') { + + @@dns_record { "AAAA automatic ${::fqdn}": + type => 'AAAA', + zone => $facts['domain'], + key => $facts['hostname'], + value => $facts['ipaddress6'], + } - [$record, $zone] = dns_record::rev_record( - $facts['networking']['ip6'], - $facts['networking']['netmask6']) + [$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}.", + @@dns_record { "PTR automatic ${::fqdn}": + type => 'PTR', + zone => $zone, + key => $record, + value => "${::fqdn}.", + } } } -- cgit v1.2.3