Skip to content

Instantly share code, notes, and snippets.

@dcarley
Created November 14, 2011 09:52
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 dcarley/1363634 to your computer and use it in GitHub Desktop.
Save dcarley/1363634 to your computer and use it in GitHub Desktop.
puppetlabs-firewall duplicate resources
[root@fw0 ~]# iptables -F
[root@fw0 ~]# cat test.pp
firewall {
"500 http":
dport => 80,
action => "accept";
"500 https":
dport => 443,
action => "accept";
}
resources { "firewall":
purge => true,
}
[root@fw0 ~]# puppet apply --modulepath /vagrant/puppet/modules test.pp
notice: /Firewall[500 https]/ensure: created
notice: /Firewall[500 http]/ensure: created
notice: Finished catalog run in 0.17 seconds
[root@fw0 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere multiport dports http /* 500 http */
ACCEPT tcp -- anywhere anywhere multiport dports https /* 500 https */
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@fw0 ~]# /sbin/iptables -I INPUT -t filter -p tcp -m multiport --dports 8080 -m comment --comment "500 http" -j ACCEPT
[root@fw0 ~]# puppet apply --modulepath /vagrant/puppet/modules test.pp
warning: Firewall 500 http found in both iptables and iptables; skipping the iptables version
notice: Finished catalog run in 0.07 seconds
[root@fw0 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere multiport dports webcache /* 500 http */
ACCEPT tcp -- anywhere anywhere multiport dports http /* 500 http */
ACCEPT tcp -- anywhere anywhere multiport dports https /* 500 https */
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment