Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Fix up default DNS recipe to accept sane defaults from the DSN server…
Browse files Browse the repository at this point in the history
… role.
  • Loading branch information
VictorLowther committed Feb 28, 2013
1 parent 466ea87 commit f67b0e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions chef/cookbooks/bind9/recipes/default.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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]}."]
Expand Down
2 changes: 1 addition & 1 deletion chef/roles/dns-server.rb
Expand Up @@ -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()
Expand Down

0 comments on commit f67b0e4

Please sign in to comment.