powerdns: switch to AXFR for secondarie
This commit is contained in:
parent
31e614ab3b
commit
c93a4d0a99
5 changed files with 24 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
||||||
% for zone in sorted(zones):
|
% for zone in sorted(zones):
|
||||||
zone "${zone}" {
|
zone "${zone}" {
|
||||||
file "/var/lib/powerdns/zones/${zone}";
|
file "/var/lib/powerdns/zones/${zone}";
|
||||||
type native;
|
type master;
|
||||||
};
|
};
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -27,6 +27,8 @@ superslave=yes
|
||||||
api=yes
|
api=yes
|
||||||
api-key=${api_key}
|
api-key=${api_key}
|
||||||
webserver=yes
|
webserver=yes
|
||||||
|
webserver-address=0.0.0.0
|
||||||
|
webserver-allow-from=0.0.0.0/0
|
||||||
|
|
||||||
allow-notify-from=
|
allow-notify-from=
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,11 @@ files = {
|
||||||
'/etc/powerdns/pdns.conf': {
|
'/etc/powerdns/pdns.conf': {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': {
|
||||||
'api_key': node.metadata['powerdns']['api_key'],
|
'api_key': node.metadata.get('powerdns/api_key'),
|
||||||
'my_hostname': node.metadata['powerdns'].get('my_hostname', node.metadata.get('hostname')),
|
'my_hostname': node.metadata.get('powerdns/my_hostname', node.metadata.get('hostname')),
|
||||||
'is_secondary': node.metadata['powerdns'].get('is_secondary', False),
|
'is_secondary': node.metadata.get('powerdns/is_secondary', False),
|
||||||
'my_primary_servers': node.metadata['powerdns'].get('my_primary_servers', set()),
|
'my_primary_servers': node.metadata.get('powerdns/my_primary_servers', set()),
|
||||||
'my_secondary_servers': node.metadata['powerdns'].get('my_secondary_servers', set()),
|
'my_secondary_servers': node.metadata.get('powerdns/my_secondary_servers', set()),
|
||||||
},
|
},
|
||||||
'needs': {
|
'needs': {
|
||||||
'pkg_apt:pdns-server',
|
'pkg_apt:pdns-server',
|
||||||
|
@ -142,12 +142,22 @@ if node.metadata.get('powerdns/features/bind', False):
|
||||||
'action:powerdns_reload_zones',
|
'action:powerdns_reload_zones',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
files['/etc/powerdns/named.conf'] = {
|
||||||
|
'delete': True,
|
||||||
|
'needed_by': {
|
||||||
|
'svc_systemd:pdns',
|
||||||
|
},
|
||||||
|
'triggers': {
|
||||||
|
'action:powerdns_reload_zones',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
if node.metadata.get('powerdns/features/pgsql', False):
|
if node.metadata.get('powerdns/features/pgsql', node.has_bundle('postgresql')):
|
||||||
files['/etc/powerdns/pdns.d/pgsql.conf'] = {
|
files['/etc/powerdns/pdns.d/pgsql.conf'] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': {
|
||||||
'password': node.metadata['postgresql']['roles']['powerdns']['password'],
|
'password': node.metadata.get('postgresql/roles/powerdns/password'),
|
||||||
},
|
},
|
||||||
'needs': {
|
'needs': {
|
||||||
'pkg_apt:pdns-backend-pgsql',
|
'pkg_apt:pdns-backend-pgsql',
|
||||||
|
@ -163,7 +173,7 @@ if node.metadata.get('powerdns/features/pgsql', False):
|
||||||
files['/etc/powerdns/schema.pgsql.sql'] = {}
|
files['/etc/powerdns/schema.pgsql.sql'] = {}
|
||||||
|
|
||||||
actions['powerdns_load_pgsql_schema'] = {
|
actions['powerdns_load_pgsql_schema'] = {
|
||||||
'command': node.metadata['postgresql']['roles']['powerdns']['password'].format_into('PGPASSWORD={} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'),
|
'command': node.metadata.get('postgresql/roles/powerdns/password').format_into('PGPASSWORD={} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'),
|
||||||
'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',
|
||||||
|
|
|
@ -12,10 +12,6 @@ groups['dns'] = {
|
||||||
},
|
},
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'powerdns': {
|
'powerdns': {
|
||||||
'features': {
|
|
||||||
'bind': True,
|
|
||||||
'pgsql': True,
|
|
||||||
},
|
|
||||||
# Overridden in node metadata for primary server
|
# Overridden in node metadata for primary server
|
||||||
'is_secondary': True,
|
'is_secondary': True,
|
||||||
},
|
},
|
||||||
|
|
|
@ -47,6 +47,9 @@ nodes['gce.bind01'] = {
|
||||||
'version': '15',
|
'version': '15',
|
||||||
},
|
},
|
||||||
'powerdns': {
|
'powerdns': {
|
||||||
|
'features': {
|
||||||
|
'bind': True,
|
||||||
|
},
|
||||||
'is_secondary': False,
|
'is_secondary': False,
|
||||||
'secondary_nameservers': 'dns',
|
'secondary_nameservers': 'dns',
|
||||||
'my_hostname': 'ns-1.kunbox.net',
|
'my_hostname': 'ns-1.kunbox.net',
|
||||||
|
|
Loading…
Reference in a new issue