chef-lctp/site-cookbooks/bind/recipes/default.rb

39 lines
812 B
Ruby
Raw Normal View History

2014-01-19 14:34:01 +00:00
package 'bind9'
execute "reload named" do
command "rndc reconfig"
action :nothing
end
template "/etc/bind/named.conf" do
source "named.conf.erb"
notifies :run, "execute[reload named]", :delayed
end
template "/etc/bind/named.conf.options" do
source "named.conf.options.erb"
notifies :run, "execute[reload named]", :delayed
end
service "bind9" do
action [:enable, :start]
supports status: true, start: true, stop: true, restart: true
end
node.bind.zones.each do |name, zone|
execute "update #{name} zone" do
command "rndc reload #{name}"
action :nothing
end
2014-01-20 15:10:18 +00:00
template "/etc/bind/#{name}" do
2014-01-19 14:34:01 +00:00
source "zone.erb"
2014-01-20 15:10:18 +00:00
mode "0660"
owner "root"
owner "bind"
2014-01-19 14:34:01 +00:00
notifies :run, "execute[update #{name} zone]"
2014-01-20 15:10:18 +00:00
variables(zone: zone, zone_name: name, node: node)
2014-01-19 14:34:01 +00:00
end
end