bundles/powerdns: only reload pdns on zone changes, don't restart
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
c5fc67660a
commit
31cc74951b
1 changed files with 24 additions and 16 deletions
|
@ -75,6 +75,16 @@ svc_systemd = {
|
|||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'powerdns_reload_zones': {
|
||||
'triggered': True,
|
||||
'command': 'pdns_control rediscover; pdns_control reload',
|
||||
'needs': {
|
||||
'svc_systemd:pdns',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
||||
primary_zones = set()
|
||||
for zone in listdir(zone_path):
|
||||
|
@ -97,7 +107,7 @@ if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
|||
},
|
||||
'source': 'bind-zones/{}'.format(zone),
|
||||
'triggers': {
|
||||
'svc_systemd:pdns:reload',
|
||||
'action:powerdns_reload_zones',
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -106,7 +116,7 @@ if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
|||
'pkg_apt:pdns-backend-bind',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:pdns:restart',
|
||||
'action:powerdns_reload_zones',
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -119,7 +129,7 @@ if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
|||
'pkg_apt:pdns-backend-bind',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:pdns:reload',
|
||||
'action:powerdns_reload_zones',
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -133,14 +143,13 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False):
|
|||
'pkg_apt:pdns-backend-pgsql',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:pdns:restart',
|
||||
'action:powerdns_reload_zones',
|
||||
},
|
||||
}
|
||||
|
||||
files['/etc/powerdns/schema.pgsql.sql'] = {}
|
||||
|
||||
actions = {
|
||||
'powerdns_load_pgsql_schema': {
|
||||
actions['powerdns_load_pgsql_schema'] = {
|
||||
'command': 'PGPASSWORD={pw} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'.format(pw=node.metadata['postgresql']['users']['powerdns']['password']),
|
||||
'unless': 'sudo -u postgres psql -d powerdns -c "\dt" | grep domains 2>&1 >/dev/null',
|
||||
'needs': {
|
||||
|
@ -151,4 +160,3 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False):
|
|||
'svc_systemd:pdns',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue