bundles/powerdns: we don't need the node names of primary nameservers
This commit is contained in:
parent
43bd6b4774
commit
7a3e3ad68f
2 changed files with 21 additions and 7 deletions
|
@ -14,7 +14,8 @@ server-id=${my_hostname}
|
|||
default-ttl=60
|
||||
|
||||
% if is_secondary:
|
||||
# Primary servers: ${', '.join(sorted(my_primary_servers['nodes']))}
|
||||
allow-notify-from=${','.join(sorted(my_primary_servers))}
|
||||
|
||||
slave=yes
|
||||
superslave=yes
|
||||
allow-notify-from=${','.join(sorted(my_primary_servers['ips']))}
|
||||
|
|
|
@ -27,26 +27,39 @@ defaults = {
|
|||
}
|
||||
|
||||
|
||||
@metadata_reactor
|
||||
def get_ips_of_secondary_nameservers(metadata):
|
||||
if metadata.get('powerdns/is_secondary', False):
|
||||
return {}
|
||||
|
||||
ips = set()
|
||||
for rnode in repo.nodes_in_group('dns'):
|
||||
if rnode.metadata.get('powerdns/is_secondary', False):
|
||||
ips.update({
|
||||
str(ip) for ip in repo.libs.tools.resolve_identifier(repo, rnode.name)
|
||||
})
|
||||
|
||||
return {
|
||||
'powerdns': {
|
||||
'my_secondary_servers': ips,
|
||||
},
|
||||
}
|
||||
|
||||
@metadata_reactor
|
||||
def get_ips_of_primary_nameservers(metadata):
|
||||
if not metadata.get('powerdns/is_secondary', False):
|
||||
return {}
|
||||
|
||||
ips = set()
|
||||
nodes = set()
|
||||
for rnode in repo.nodes_in_group('dns'):
|
||||
if not rnode.metadata.get('powerdns/is_secondary', False):
|
||||
ips.update({
|
||||
str(ip) for ip in repo.libs.tools.resolve_identifier(repo, rnode.name)
|
||||
})
|
||||
nodes.add(rnode.name)
|
||||
|
||||
return {
|
||||
'powerdns': {
|
||||
'my_primary_servers': {
|
||||
'ips': ips,
|
||||
'nodes': nodes,
|
||||
},
|
||||
'my_primary_servers': ips,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue