]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Add ip protocol to puppetlabs-firewall
authorMorten Brekkevold <morten.brekkevold@uninett.no>
Wed, 17 Feb 2016 12:07:24 +0000 (13:07 +0100)
committerMorten Brekkevold <morten.brekkevold@uninett.no>
Wed, 17 Feb 2016 12:07:24 +0000 (13:07 +0100)
README.markdown
lib/puppet/type/firewall.rb
spec/unit/puppet/type/firewall_spec.rb

index 26467e034e621c3868a267ca29f9e892eccf968b..baf784fb5fa334fb232e611d6185fa609847fb90 100644 (file)
@@ -628,6 +628,7 @@ firewall { '999 this runs last':
 * `port`: *DEPRECATED* Using the unspecific 'port' parameter can lead to firewall rules that are unexpectedly too lax. It is recommended to always use the specific dport and sport parameters to avoid this ambiguity. The destination or source port to match for this filter (if the protocol supports ports). Will accept a single element or an array. For some firewall providers you can pass a range of ports in the format: 'start number-end number'. For example, '1-1024' would cover ports 1 to 1024.
 
 * `proto`: The specific protocol to match for this rule. This is 'tcp' by default. Valid values are:
+  * 'ip'
   * 'tcp'
   * 'udp'
   * 'icmp'
index 4073d6ca075b9d31a8cb6f2da36c0c32c1320240..2529d19803ab170bef7657336484df6a0e9aef4d 100644 (file)
@@ -369,7 +369,7 @@ Puppet::Type.newtype(:firewall) do
       *tcp*.
     EOS
 
-    newvalues(*[:tcp, :udp, :icmp, :"ipv6-icmp", :esp, :ah, :vrrp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :cbt, :sctp, :pim, :all].collect do |proto|
+    newvalues(*[:ip, :tcp, :udp, :icmp, :"ipv6-icmp", :esp, :ah, :vrrp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :cbt, :sctp, :pim, :all].collect do |proto|
       [proto, "! #{proto}".to_sym]
     end.flatten)
     defaultto "tcp"
index 3e4804df476f9aa0ce10acedef0eabc65388da60..c5fdfd8429587e1b2704cca58525aa7b5cdcbb4e 100755 (executable)
@@ -82,7 +82,7 @@ describe firewall do
   end
 
   describe ':proto' do
-    [:tcp, :udp, :icmp, :esp, :ah, :vrrp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :pim, :all].each do |proto|
+    [:ip, :tcp, :udp, :icmp, :esp, :ah, :vrrp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :pim, :all].each do |proto|
       it "should accept proto value #{proto}" do
         @resource[:proto] = proto
         @resource[:proto].should == proto