bundles/powerdns: fix dependencies

This commit is contained in:
Franzi 2020-10-16 17:59:46 +02:00
parent 72abcae348
commit a553e736d1
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -28,25 +28,23 @@ $TTL 60
IN NS d.ns14.net. IN NS d.ns14.net.
""" """
default_attributes = {
'needs': {
'pkg_apt:pdns-server',
'pkg_apt:pdns-backend-bind',
'pkg_apt:pdns-backend-pgsql',
},
'triggers': {
'svc_systemd:pdns:restart',
},
}
directories = { directories = {
'/etc/powerdns/pdns.d': { '/etc/powerdns/pdns.d': {
'purge': True, 'purge': True,
**default_attributes, 'needs': {
'pkg_apt:pdns-server',
'pkg_apt:pdns-backend-bind',
'pkg_apt:pdns-backend-pgsql',
},
'triggers': {
'svc_systemd:pdns:restart',
},
}, },
'/var/lib/powerdns/zones': { '/var/lib/powerdns/zones': {
'purge': True, 'purge': True,
**default_attributes 'needs': {
'pkg_apt:pdns-backend-bind',
},
} }
} }
@ -56,7 +54,12 @@ files = {
'context': { 'context': {
'api_key': node.metadata['powerdns']['api_key'], 'api_key': node.metadata['powerdns']['api_key'],
}, },
**default_attributes, 'needs': {
'pkg_apt:pdns-server',
},
'triggers': {
'svc_systemd:pdns:restart',
},
}, },
} }
@ -65,6 +68,9 @@ svc_systemd = {
'needs': { 'needs': {
'directory:', 'directory:',
'file:', 'file:',
'pkg_apt:pdns-server',
'pkg_apt:pdns-backend-bind',
'pkg_apt:pdns-backend-pgsql',
}, },
}, },
} }
@ -90,14 +96,28 @@ if node.metadata['powerdns'].get('features', {}).get('bind', False):
'metadata_records': node.metadata.get('powerdns', {}).get('bind-zones', {}).get(zone, {}).get('records', []), 'metadata_records': node.metadata.get('powerdns', {}).get('bind-zones', {}).get(zone, {}).get('records', []),
}, },
'source': 'bind-zones/{}'.format(zone), 'source': 'bind-zones/{}'.format(zone),
**default_attributes 'triggers': {
'svc_systemd:pdns:reload',
},
} }
files['/etc/powerdns/pdns.d/bind.conf'] = default_attributes files['/etc/powerdns/pdns.d/bind.conf'] = {
'needs': {
'pkg_apt:pdns-backend-bind',
},
'triggers': {
'svc_systemd:pdns:restart',
},
}
files['/etc/powerdns/named.conf'] = { files['/etc/powerdns/named.conf'] = {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'zones': primary_zones, 'zones': primary_zones,
}, },
**default_attributes 'needs': {
'pkg_apt:pdns-backend-bind',
},
'triggers': {
'svc_systemd:pdns:reload',
},
} }