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,7 +28,9 @@ $TTL 60
IN NS d.ns14.net.
"""
default_attributes = {
directories = {
'/etc/powerdns/pdns.d': {
'purge': True,
'needs': {
'pkg_apt:pdns-server',
'pkg_apt:pdns-backend-bind',
@ -37,16 +39,12 @@ default_attributes = {
'triggers': {
'svc_systemd:pdns:restart',
},
}
directories = {
'/etc/powerdns/pdns.d': {
'purge': True,
**default_attributes,
},
'/var/lib/powerdns/zones': {
'purge': True,
**default_attributes
'needs': {
'pkg_apt:pdns-backend-bind',
},
}
}
@ -56,7 +54,12 @@ files = {
'context': {
'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': {
'directory:',
'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', []),
},
'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'] = {
'content_type': 'mako',
'context': {
'zones': primary_zones,
},
**default_attributes
'needs': {
'pkg_apt:pdns-backend-bind',
},
'triggers': {
'svc_systemd:pdns:reload',
},
}