diff --git a/bundles/bind/items.py b/bundles/bind/items.py index f62c5d3..96de8b1 100644 --- a/bundles/bind/items.py +++ b/bundles/bind/items.py @@ -137,6 +137,13 @@ for view in views: } for zone, records in zones.items(): + unique_records = [ + dict(record_tuple) + for record_tuple in set( + tuple(record.items()) for record in records + ) + ] + files[f"/var/lib/bind/{view['name']}/db.{zone}"] = { 'group': 'bind', 'source': 'db', @@ -146,7 +153,7 @@ for view in views: 'serial': datetime.now().strftime('%Y%m%d%H'), 'records': list(filter( lambda record: use_record(record, records, view['name']), - records + unique_records )), 'hostname': node.metadata.get('bind/hostname'), }, diff --git a/bundles/grafana/metadata.py b/bundles/grafana/metadata.py index 7230362..90089d1 100644 --- a/bundles/grafana/metadata.py +++ b/bundles/grafana/metadata.py @@ -96,15 +96,15 @@ def datasource_key_to_name(metadata): } -# @metadata_reactor.provides( -# 'dns', -# ) -# def dns(metadata): -# return { -# 'dns': { -# metadata.get('grafana/hostname'): repo.libs.dns.get_a_records(metadata), -# } -# } +@metadata_reactor.provides( + 'dns', +) +def dns(metadata): + return { + 'dns': { + metadata.get('grafana/hostname'): repo.libs.dns.get_a_records(metadata), + } + } @metadata_reactor.provides( diff --git a/bundles/influxdb2/metadata.py b/bundles/influxdb2/metadata.py index c26fcb1..20e834d 100644 --- a/bundles/influxdb2/metadata.py +++ b/bundles/influxdb2/metadata.py @@ -44,15 +44,15 @@ def admin_password(metadata): } -# @metadata_reactor.provides( -# 'dns', -# ) -# def dns(metadata): -# return { -# 'dns': { -# metadata.get('influxdb/hostname'): repo.libs.dns.get_a_records(metadata), -# } -# } +@metadata_reactor.provides( + 'dns', +) +def dns(metadata): + return { + 'dns': { + metadata.get('influxdb/hostname'): repo.libs.dns.get_a_records(metadata), + } + } @metadata_reactor.provides(