PowerDNS instead of bind9 #2

Merged
kunsi merged 23 commits from kunsi-feature-powerdns-instead-of-bind into main 2020-10-17 11:12:35 +00:00
Showing only changes of commit a553e736d1 - Show all commits

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',
},
}