Skip to content

Instantly share code, notes, and snippets.

@jbritten
Created June 16, 2009 04:37
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 jbritten/130525 to your computer and use it in GitHub Desktop.
Save jbritten/130525 to your computer and use it in GitHub Desktop.
package :iptables, :provides => :firewall do
description 'Configure IPTables Firewall'
# Need to run some commands, don't see how to do this unless I hook into a package install
# So, faking a push_text
push_text '', '/dev/null' do
#
# Allow SSH connections on tcp port 22
#
post :install, '/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT'
#
# Save settings
#
post :install, '/sbin/service iptables save'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment