diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-02-27 23:05:26 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-02-28 12:59:31 +0100 |
commit | 293adf31163ba4268c3dfb2697a9e8beadb4fd54 (patch) | |
tree | 40b2e3149cb5c67b7832f44bb85a0dcc66286694 | |
parent | Add profile tftp. (diff) | |
download | profiles-293adf31163ba4268c3dfb2697a9e8beadb4fd54.tar.gz profiles-293adf31163ba4268c3dfb2697a9e8beadb4fd54.tar.xz |
Made dns_record autoreport more forgiving.
-rw-r--r-- | manifests/publish_dns.pp | 31 |
1 files changed, 17 insertions, 14 deletions
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}.", + } } } |