bundles/powerdns: add private ipv6 addresses as well

This commit is contained in:
Franzi 2024-02-26 06:34:30 +01:00
parent e73dcf16e3
commit 0d0548311c
Signed by: kunsi
GPG Key ID: 12E3D2136B818350
1 changed files with 4 additions and 1 deletions

View File

@ -143,11 +143,14 @@ def generate_dns_entries_for_nodes(metadata):
if not ip6 and not ip.is_private:
ip6 = ip
if not (ip4 or ip6) and found_ips['ipv4']:
if not (ip4 or ip6) and (found_ips['ipv4'] or found_ips['ipv6']):
# do it again, but do not filter out private addresses
for ip in sorted(found_ips['ipv4']):
if not ip4:
ip4 = ip
for ip in sorted(found_ips['ipv6']):
if not ip6:
ip6 = ip
if ip4:
results.add('{} IN A {}'.format(dns_name, ip4))