Skip to content

Commit

Permalink
Fixed various template problems. One of my domains is now getting ser…
Browse files Browse the repository at this point in the history
…ved by a node using this cookbook.
  • Loading branch information
fooforge committed Sep 16, 2011
1 parent 55ad10d commit 5defd3b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs/Configures bind9"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.3"
version "0.1.4"

%w{ ubuntu debian }.each do |os|
supports os
Expand Down
2 changes: 1 addition & 1 deletion templates/default/named.conf.local.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% @zonefiles.each do |conf| -%>
zone "<%= conf["domain"] %>" IN {
type <%= conf["type"] %>;
file "<%= conf["domain"] %>";
file "/etc/bind/<%= conf["domain"] %>";
allow-transfer {
<% conf["allow_transfer"].each do |ip| -%>
<%= ip %>;
Expand Down
12 changes: 8 additions & 4 deletions templates/default/zonefile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ $TTL <%= @global_ttl %>
1D ; minimum
);

IN NS <%= @soa %>
IN NS <%= @soa %>
<% @nameserver.each do |ns| -%>
IN NS <%= ns %>
IN NS <%= ns %>
<% end %>
<% @mail_exchange.each do |mx| -%>
IN MX <%= mx['priority'] %> <%= mx['host'] %>
IN MX <%= mx['priority'] %> <%= mx['host'] %>
<% end %>

IN A <%= node['ipaddress'] %>
ns IN A <%= node['ipaddress'] %>
<% @records.each do |record| -%>
<%= "%-20s %5s IN %5s %s" % [record['name'],record['ttl'],record['type'],record['ip']] %>
<%= "%-20s %5s IN %5s %s" % [record['name'],record['ttl'],record['type'],record['ip']] %>
<% end %>

0 comments on commit 5defd3b

Please sign in to comment.