]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
MODULES-633 - Fix for ip6tables
authorMorgan Haskel <morgan@puppetlabs.com>
Fri, 23 Jan 2015 18:15:01 +0000 (10:15 -0800)
committerMorgan Haskel <morgan@puppetlabs.com>
Mon, 26 Jan 2015 17:48:55 +0000 (09:48 -0800)
If the packages for ip6tables aren't installed, the provider will throw
an exception. Fix the provider to check to make sure the variable exists
first, and update params.pp to include the required package for EL6.

lib/puppet/provider/firewall/ip6tables.rb
manifests/params.pp

index b5df9a7a4da7bfd99c4c332949808862cb82a441..2ed3c13da8c2ca516d5c73c54f89a04093011777 100644 (file)
@@ -45,7 +45,8 @@ Puppet::Type.type(:firewall).provide :ip6tables, :parent => :iptables, :source =
 
 
   def initialize(*args)
-    if Facter.fact('ip6tables_version').value.match /1\.3\.\d/
+    ip6tables_version = Facter.value('ip6tables_version')
+    if ip6tables_version and ip6tables_version.match /1\.3\.\d/
       raise ArgumentError, 'The ip6tables provider is not supported on version 1.3 of iptables'
     else
       super
index 4d66159bde928fa0271795b6c12e00f6789c33f7..9fa43a0c71f508c664b2df3562df5d1abcaaa875 100644 (file)
@@ -22,7 +22,7 @@ class firewall::params {
           if versioncmp($::operatingsystemrelease, '7.0') >= 0 {
             $package_name = 'iptables-services'
           } else {
-            $package_name = undef
+            $package_name = 'iptables-ipv6'
           }
           $service_name = 'iptables'
         }