]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
add negation support for ipset
authorAlexey Lapitsky <alexey@spotify.com>
Fri, 19 Sep 2014 19:19:49 +0000 (15:19 -0400)
committerAlexey Lapitsky <alexey@spotify.com>
Sun, 19 Oct 2014 19:00:47 +0000 (21:00 +0200)
lib/puppet/provider/firewall/iptables.rb

index c8e30800629bc0a4c2beca0185b781fc32240e13..300d5255d95ccb817cb24f397789d2a6a5d18d35 100644 (file)
@@ -225,7 +225,7 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
     # so it behaves like --comment
     values = values.gsub(/(!\s+)?--tcp-flags (\S*) (\S*)/, '--tcp-flags "\1\2 \3"')
     # ditto for --match-set
-    values = values.sub(/--match-set (\S*) (\S*)/, '--match-set "\1 \2"')
+    values = values.sub(/(!\s+)?--match-set (\S*) (\S*)/, '--match-set "\1\2 \3"')
     # we do a similar thing for negated address masks (source and destination).
     values = values.gsub(/(-\S+) (!)\s?(\S*)/,'\1 "\2 \3"')
     # the actual rule will have the ! mark before the option.
@@ -331,6 +331,7 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
       :dport,
       :dst_range,
       :dst_type,
+      :ipset,
       :port,
       :proto,
       :source,