Created
July 12, 2012 17:17
-
-
Save linusthe3rd/3099443 to your computer and use it in GitHub Desktop.
The commands needed to set an iptables configuration from an ERB template in Chef.
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
template "/etc/sysconfig/iptables" do | |
source "iptables.erb" | |
owner "root" | |
group "root" | |
mode "0600" | |
end | |
# Ensure that the iptables file adheres to the selinux requirements | |
execute "chcon" do | |
command "chcon system_u:object_r:system_conf_t:s0 /etc/sysconfig/iptables" | |
action :run | |
end | |
execute "service" do | |
command "service iptables save" | |
action :run | |
end | |
service "iptables" do | |
action :restart | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment