Skip to content

Commit 82ff9bb

Browse files
Sumit JamgadeRitesh Anand
authored andcommitted
desginate: simplify sample pool and modify it for HA (SCRD-9142)
In crowbar's world the dns-master is the master of all and slaves forward all queries to dns-master. When designate is enabled, designate-mdns service component(s) become the hidden master(s). We leave 'also_notifies' empty. It can be configured by the users via designate-manage utility as and when needed. designate-mdns service components, in HA, will be running on multiple hosts and any host can be asked to update a zone (when a recordset, corresponding to a vm is created) on th real-master so all have to be listed as master in the pool. The host with VIP will use that ip as the outgoing ip when connecting to the real-master, so it should also be named as master for the zone.
1 parent 797307d commit 82ff9bb

File tree

1 file changed

+15
-7
lines changed
  • chef/cookbooks/designate/recipes

1 file changed

+15
-7
lines changed

chef/cookbooks/designate/recipes/mdns.rb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,23 @@
2020

2121
dns = node_search_with_cache("roles:dns-server").first
2222
dnsmaster = dns[:dns][:master_ip]
23-
dnsslaves = dns[:dns][:slave_ips].to_a
24-
dnsservers = [dnsmaster] + dnsslaves
2523

26-
network_settings = DesignateHelper.network_settings(node)
24+
# hidden masters are designate-mdns services, in ha this service will be running on multiple
25+
# hosts and any host can be asked to update the zone (when a recordset, corresponding to a vm is
26+
# created) on the real-master so all have to be listed as master in the pool.
27+
hiddenmasters = node_search_with_cache("roles:designate-server").map do |n|
28+
{ "host" => Barclamp::Inventory.get_network_by_type(n, "admin").address, "port" => 5354 }
29+
end
30+
31+
# the host with VIP will use that ip as the outgoing ip when connecting to the real-master
32+
if node[:designate][:ha][:enabled]
33+
hiddenmasters += [{ "host" => CrowbarPacemakerHelper.cluster_vip(node, "admin"), "port" => 5354 }]
34+
end
2735

2836
# One could have multiple pools in desginate. And
2937
# Desginate needs to have a default pool, this pools
3038
# id is hardcoded in the designate conf. By reusing that
31-
# id we let designate know how crowbar's deployement of
39+
# id we let designate know how crowbar's deployment of
3240
# dns servers looks like.
3341
# This pool id can be generated by in proposal, but this will change
3442
# with every delete/create cycle of proposal. This might mess
@@ -41,11 +49,11 @@
4149
"attributes" => {},
4250
"ns_records" => [{ "hostname" => "#{dns[:fqdn]}.", "priority" => 1 }],
4351
"nameservers" => dnsservers.map { |ip| { "host" => ip, "port" => 53 } },
44-
"also_notifies" => dnsslaves.map { |ip| { "host" => ip, "port" => 53 } },
52+
"also_notifies" => [],
4553
"targets" => [{
4654
"type" => "bind9",
47-
"description" => "BIND9 Server 1",
48-
"masters" => [{ "host" => network_settings[:mdns_bind_host], "port" => 5354 }],
55+
"description" => "BIND9 Server on node with role dns-server",
56+
"masters" => hiddenmasters,
4957
"options" => {
5058
"host" => dnsmaster,
5159
"port" => 53,

0 commit comments

Comments
 (0)