]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Update firewall.rb
authorpellisesol <55718611+pellisesol@users.noreply.github.com>
Fri, 2 Oct 2020 17:06:33 +0000 (12:06 -0500)
committeradrianiurca <adrian.iurca@gmail.com>
Thu, 9 Sep 2021 12:44:26 +0000 (15:44 +0300)
On Gentoo using 'vrrp' sets the proto to 112 but when puppet runs it interprets 112 as 'carp' which it then corrects to 'vrrp' which is still 112. So it redoes the rule every time puppet runs. Adding carp here allows carp to be set as a valid option which removes the loop.

lib/puppet/type/firewall.rb

index d46316bf7e0fb2f62dd6bdcf84a65d1fb68b74fa..ae751e0c3bf3e7e542183d949bc44dd1365ee1b0 100644 (file)
@@ -554,7 +554,7 @@ Puppet::Type.newtype(:firewall) do
       The specific protocol to match for this rule.
     PUPPETCODE
 
-    newvalues(*[:ip, :tcp, :udp, :icmp, :"ipv6-icmp", :esp, :ah, :vrrp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :cbt, :sctp, :pim, :all].map { |proto|
+    newvalues(*[:ip, :tcp, :udp, :icmp, :"ipv6-icmp", :esp, :ah, :vrrp, :carp, :igmp, :ipencap, :ipv4, :ipv6, :ospf, :gre, :cbt, :sctp, :pim, :all].map { |proto|
       [proto, "! #{proto}".to_sym]
     }.flatten)
     defaultto 'tcp'