Skip to content

Instantly share code, notes, and snippets.

@charlesjohnson
Created November 7, 2012 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesjohnson/4033583 to your computer and use it in GitHub Desktop.
Save charlesjohnson/4033583 to your computer and use it in GitHub Desktop.
Conditional notification example
template "/etc/bind/named.conf.local" do
source "named.conf.local.erb"
owner "root"
group "bind"
mode 00644
variables({
:role => node["bind"]["role"],
:masters => node["bind"]["masters"],
:directory => node["bind"]["zone_dir"]
})
notifies :run, "execute[test bind config files]"
end
execute "test bind config files" do
action :nothing
command "named-checkconf"
notifies :restart, "service[bind9]"
end
service "bind9" do
action [:enable, :start]
supports :restart => true, :reload => true, :status => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment