diff --git a/bundles/bind/items.py b/bundles/bind/items.py index a166f2b..d28a49e 100644 --- a/bundles/bind/items.py +++ b/bundles/bind/items.py @@ -136,7 +136,8 @@ for view in views: ], } - for zone, records in zones.items(): + for zone, record_dicts in zones.items(): + records = record_dicts.values() unique_records = [ dict(record_tuple) for record_tuple in set( diff --git a/bundles/bind/metadata.py b/bundles/bind/metadata.py index 10cc137..9e0bc17 100644 --- a/bundles/bind/metadata.py +++ b/bundles/bind/metadata.py @@ -1,4 +1,5 @@ from ipaddress import ip_interface +from json import dumps defaults = { @@ -74,11 +75,12 @@ def collect_records(metadata): for type, values in records.items(): for value in values: + entry = {'name': name, 'type': type, 'value': value} zones\ - .setdefault(zone, [])\ - .append( - {'name': name, 'type': type, 'value': value} - ) + .setdefault(zone, {})\ + .update({ + str(hash(dumps(entry))): entry, + }) return { 'bind': { @@ -104,10 +106,11 @@ def ns_records(metadata): return { 'bind': { 'zones': { - zone: [ - {'name': '@', 'type': 'NS', 'value': f"{nameserver}."} + zone: { + # FIXME: bw currently cant handle lists of dicts :( + str(hash(dumps({'name': '@', 'type': 'NS', 'value': f"{nameserver}."}))): {'name': '@', 'type': 'NS', 'value': f"{nameserver}."} for nameserver in nameservers - ] for zone in metadata.get('bind/zones').keys() + } for zone in metadata.get('bind/zones').keys() }, }, } diff --git a/nodes/htz.mails.py b/nodes/htz.mails.py index 1d45fd4..dca934a 100644 --- a/nodes/htz.mails.py +++ b/nodes/htz.mails.py @@ -50,6 +50,10 @@ 'A': ['162.55.188.157'], 'AAAA': ['2a01:4f8:1c1c:4121::2'], }, + 'sublimity.de': { + 'A': ['162.55.188.157'], + 'AAAA': ['2a01:4f8:1c1c:4121::2'], + }, 'freibrief.net': { 'A': ['162.55.188.157'], 'AAAA': ['2a01:4f8:1c1c:4121::2'],