Skip to content

Instantly share code, notes, and snippets.

@lusis
Created August 19, 2014 13:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/ccbaef36fca928444824 to your computer and use it in GitHub Desktop.
Save lusis/ccbaef36fca928444824 to your computer and use it in GitHub Desktop.
iptables-slack-notify-chef.rb
slack "iptables-rules-changed-#{node.name}" do
message "iptables.sav was updated on #{node.name}! This should be investigated"
icon_url node['chef_client']['handler']['slack']['icon_url']
channel node['chef_client']['handler']['slack']['channel']
username "Chef iptables notifier"
action :nothing
end
template "/etc/iptables.sav" do
owner "root"
group "root"
mode "0640"
notifies :say, "slack[iptables-rules-changed-#{node.name}]", :immediately
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment