Browse Source

move hostname stuff to libs.tools.resolve_identifier

main
Franzi 2 weeks ago
parent
commit
906b63b123
Signed by: kunsi GPG Key ID: 12E3D2136B818350
  1. 12
      bundles/powerdns/metadata.py
  2. 5
      libs/tools.py

12
bundles/powerdns/metadata.py

@ -159,18 +159,6 @@ def generate_dns_entries_for_nodes(metadata):
if not ip4 and isinstance(addr, IPv4Address):
ip4 = addr
if not ip4:
try:
ip4 = IPv4Address(rnode.hostname)
except ValueError:
pass
if not ip6:
try:
ip6 = IPv6Address(rnode.hostname)
except ValueError:
pass
if ip4:
results.add('{} IN A {}'.format(dns_name, ip4))

5
libs/tools.py

@ -42,6 +42,11 @@ def resolve_identifier(repo, identifier):
if node.metadata.get('external_ipv4', None):
found_ips.add(ip_address(node.metadata.get('external_ipv4')))
try:
found_ips.add(ip_address(node.hostname))
except ValueError:
pass
ip_dict = {
'ipv4': set(),
'ipv6': set(),

Loading…
Cancel
Save