Skip to content
Browse files

Fix up default DNS recipe to accept sane defaults from the DSN server…

… role.
  • Loading branch information...
1 parent 466ea87 commit f67b0e41d67afbbe389a0d5270f0c9de5eabfc3e @VictorLowther VictorLowther committed Feb 27, 2013
Showing with 4 additions and 13 deletions.
  1. +3 −12 chef/cookbooks/bind9/recipes/default.rb
  2. +1 −1 chef/roles/dns-server.rb
View
15 chef/cookbooks/bind9/recipes/default.rb
@@ -35,9 +35,9 @@
node.set[:dns][:zone_files]=Array.new
-if (node[:dns][:domain] rescue String.new) == ""
- node.set[:dns] ||= Mash.new
+if node[:dns][:domain] == ""
node.set[:dns][:domain] = node[:fqdn].split('.')[1..-1].join(".")
+ node.set[:dns][:admin] = node[:dns][:contact].tr('@','.')
end
def populate_soa_defaults(zone)
@@ -117,16 +117,7 @@ def make_zone(zone)
end
# Create our basic zone infrastructure.
-node.set[:dns][:domain] ||= node[:fqdn].split('.')[1..-1].join(".")
-node.set[:dns][:admin] ||= "support.#{node[:fqdn]}."
-node.set[:dns][:ttl] ||= "1h"
-node.set[:dns][:serial] ||= 0
-node.set[:dns][:serial] += 1
-node.set[:dns][:slave_refresh] ||= "1d"
-node.set[:dns][:slave_retry] ||= "2h"
-node.set[:dns][:slave_expire] ||= "4w"
-node.set[:dns][:negative_cache] ||= "300"
-node.set[:dns][:zones] ||= Mash.new
+node.set[:dns][:zones] = Mash.new unless node[:dns][:zones]
zones = Mash.new
localdomain = Mash.new
localdomain[:nameservers]=["#{node[:fqdn]}."]
View
2 chef/roles/dns-server.rb
@@ -14,7 +14,7 @@
"slave_refresh" => "1d",
"slave_retry" => "2h",
"slave_expire" => "4w",
- "negative_cache" => 300m
+ "negative_cache" => 300,
"config" => { "environment" => "dns-base-config" }
}
override_attributes()

0 comments on commit f67b0e4

Please sign in to comment.
Something went wrong with that request. Please try again.