This commit is contained in:
mwiegand 2021-06-18 00:01:04 +02:00
parent 704fa2ade5
commit a0c997dc23
7 changed files with 75 additions and 1 deletions

0
bundles/bind/items.py Normal file
View file

44
bundles/bind/metadata.py Normal file
View file

@ -0,0 +1,44 @@
defaults = {
'bind': {
'zones': {},
},
}
@metadata_reactor.provides(
'bind/zones',
)
def collect_records(metadata):
zones = metadata.get('bind/zones')
for other_node in repo.nodes:
print(other_node.name)
for fqdn, records in other_node.metadata.get('dns').items():
matching_zones = sorted(
filter(
lambda potential_zone: fqdn.endswith(potential_zone),
zones
),
key=len,
)
if matching_zones:
zone = matching_zones[0]
else:
continue
name = fqdn[0:-len(zone) - 1]
for type, values in records.items():
for value in values:
zones\
.setdefault(zone, [])\
.append(
(name, type, value)
)
return {
'bind': {
'zones': zones,
},
}

View file

@ -1 +1,5 @@
{}
{
'metadata': {
'dns': {},
}
}

View file

@ -0,0 +1,5 @@
{
'bundles': [
'bind',
],
}

View file

@ -1,3 +1,6 @@
{
'groups': [
'debian-10',
],
'metadata': {},
}

View file

@ -1,4 +1,7 @@
{
'groups': [
'debian-10',
],
'bundles': [
'steam',
'l4d2',

View file

@ -5,12 +5,27 @@
'debian-10',
'mailserver',
'webserver',
'dnsserver',
],
'bundles': [
'wireguard',
'zfs',
],
'metadata': {
'bind': {
'zones': {
'mail2.sublimity.de': [],
'sublimity.de': [],
'freibrief.net': [],
'nadenau.net': [],
'naeder.net': [],
'rolfwerner.eu': [],
'wettengl.net': [],
'wingl.de': [],
'woodpipe.de': [],
'ckn.li': [],
},
},
'network': {
'interface': 'eth0',
'ipv4': '162.55.188.157/32',