From f67b0e41d67afbbe389a0d5270f0c9de5eabfc3e Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Wed, 27 Feb 2013 14:21:20 -0600 Subject: [PATCH] Fix up default DNS recipe to accept sane defaults from the DSN server role. --- chef/cookbooks/bind9/recipes/default.rb | 15 +++------------ chef/roles/dns-server.rb | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/chef/cookbooks/bind9/recipes/default.rb b/chef/cookbooks/bind9/recipes/default.rb index f3d005e..8e6f116 100644 --- a/chef/cookbooks/bind9/recipes/default.rb +++ b/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]}."] diff --git a/chef/roles/dns-server.rb b/chef/roles/dns-server.rb index 4a15d6a..d821a13 100644 --- a/chef/roles/dns-server.rb +++ b/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()