36 lines
761 B
Ruby
36 lines
761 B
Ruby
|
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
|
||
|
|
||
|
template "/var/cache/bind/#{name}.zone" do
|
||
|
source "zone.erb"
|
||
|
notifies :run, "execute[update #{name} zone]"
|
||
|
variables(zone: zone, zone_name: name)
|
||
|
end
|
||
|
end
|
||
|
|