Created
October 25, 2010 04:09
-
-
Save densone/644378 to your computer and use it in GitHub Desktop.
Simple Recipe for Shorewall on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config_path = "/etc/shorewall" | |
package "shorewall" | |
cookbook_file "/etc/default/shorewall" do | |
source "shorewall-enable" | |
mode 0644 | |
owner "root" | |
group "root" | |
end | |
cookbook_file "#{config_path}/shorewall.conf" do | |
source "shorewall.conf" | |
mode 0644 | |
owner "root" | |
group "root" | |
end | |
cookbook_file "#{config_path}/interfaces" do | |
source "interfaces" | |
mode 0644 | |
owner "root" | |
group "root" | |
end | |
cookbook_file "#{config_path}/zones" do | |
source "zones" | |
mode 0644 | |
owner "root" | |
group "root" | |
end | |
cookbook_file "#{config_path}/policy" do | |
source "policy" | |
mode 0644 | |
owner "root" | |
group "root" | |
end | |
template "#{config_path}/rules" do | |
source "rules.erb" | |
mode 0644 | |
owner "root" | |
group "root" | |
variables(:rule_list => node[:config][:firewall][:rules]) | |
end | |
service "shorewall" do | |
supports :restart => true | |
action :enable | |
subscribes :restart, resources(:cookbook_file => "#{config_path}/shorewall.conf", | |
:cookbook_file => "#{config_path}/interfaces", | |
:cookbook_file => "#{config_path}/zones", | |
:cookbook_file => "#{config_path}/policy", | |
:template => "#{config_path}/rules"), :immediately | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment