PowerDNS instead of bind9 #2
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):
|
if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
||||||
primary_zones = set()
|
primary_zones = set()
|
||||||
for zone in listdir(zone_path):
|
for zone in listdir(zone_path):
|
||||||
|
@ -97,7 +107,7 @@ if node.metadata['powerdns'].get('features', {}).get('bind', False):
|
||||||
},
|
},
|
||||||
'source': 'bind-zones/{}'.format(zone),
|
'source': 'bind-zones/{}'.format(zone),
|
||||||
'triggers': {
|
'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',
|
'pkg_apt:pdns-backend-bind',
|
||||||
},
|
},
|
||||||
'triggers': {
|
'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',
|
'pkg_apt:pdns-backend-bind',
|
||||||
},
|
},
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'svc_systemd:pdns:reload',
|
'action:powerdns_reload_zones',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,22 +143,20 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False):
|
||||||
'pkg_apt:pdns-backend-pgsql',
|
'pkg_apt:pdns-backend-pgsql',
|
||||||
},
|
},
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'svc_systemd:pdns:restart',
|
'action:powerdns_reload_zones',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
files['/etc/powerdns/schema.pgsql.sql'] = {}
|
files['/etc/powerdns/schema.pgsql.sql'] = {}
|
||||||
|
|
||||||
actions = {
|
actions['powerdns_load_pgsql_schema'] = {
|
||||||
'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']),
|
||||||
'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',
|
||||||
'unless': 'sudo -u postgres psql -d powerdns -c "\dt" | grep domains 2>&1 >/dev/null',
|
'needs': {
|
||||||
'needs': {
|
'bundle:postgresql',
|
||||||
'bundle:postgresql',
|
'file:/etc/powerdns/schema.pgsql.sql',
|
||||||
'file:/etc/powerdns/schema.pgsql.sql',
|
},
|
||||||
},
|
'needed_by': {
|
||||||
'needed_by': {
|
'svc_systemd:pdns',
|
||||||
'svc_systemd:pdns',
|
},
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue