Skip to content

Commit eeae4cf

Browse files
Merge pull request #2171 from ritesh216/fix_dns_ns_records
designate: Update ns_records with all nameservers (SOC-9636)
2 parents 0d080dc + a5737d9 commit eeae4cf

File tree

1 file changed

+5
-2
lines changed
  • chef/cookbooks/designate/recipes

1 file changed

+5
-2
lines changed

chef/cookbooks/designate/recipes/mdns.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
require "yaml"
2020

21-
dns = node_search_with_cache("roles:dns-server").first
21+
dns_all = node_search_with_cache("roles:dns-server")
22+
dns = dns_all.first
2223
dnsmaster = dns[:dns][:master_ip]
2324
dnsslaves = dns[:dns][:slave_ips].to_a
2425
dnsservers = [dnsmaster] + dnsslaves
@@ -34,12 +35,14 @@
3435
# with every delete/create cycle of proposal. This might mess
3536
# up the designate configuration. So the advantage of having
3637
# non-hardcoded is high enough
38+
39+
ns_records = dns_all.map { |dnss| { "hostname" => "public-#{dnss[:fqdn]}.", "priority" => 1 } }
3740
pools = [{
3841
"name" => "default-bind",
3942
"description" => "Default BIND9 Pool",
4043
"id" => "794ccc2c-d751-44fe-b57f-8894c9f5c842",
4144
"attributes" => {},
42-
"ns_records" => [{ "hostname" => "#{dns[:fqdn]}.", "priority" => 1 }],
45+
"ns_records" => ns_records,
4346
"nameservers" => dnsservers.map { |ip| { "host" => ip, "port" => 53 } },
4447
"also_notifies" => dnsslaves.map { |ip| { "host" => ip, "port" => 53 } },
4548
"targets" => [{

0 commit comments

Comments
 (0)