]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fixed firewalld package issue
authorMartin Mágr <mmagr@redhat.com>
Fri, 24 Oct 2014 07:37:01 +0000 (09:37 +0200)
committerMartin Mágr <mmagr@redhat.com>
Fri, 24 Oct 2014 07:37:01 +0000 (09:37 +0200)
Firewalld package cannot be uninstalled, because other packages might be dependent
on it. This patch makes just firewalld service to stop and be disabled.

For more info please check: https://bugzilla.redhat.com/show_bug.cgi?id=1148399

manifests/linux/redhat.pp
spec/unit/classes/firewall_linux_redhat_spec.rb

index b7a4d0e3f770c5bb3f63edf9d2b52253b4786638..c808c7e4348d72ddccecc60816ab9a1f507995d3 100644 (file)
@@ -22,9 +22,10 @@ class firewall::linux::redhat (
   # lib/puppet/util/firewall.rb.
   if   ($::operatingsystem != 'Fedora' and versioncmp($::operatingsystemrelease, '7.0') >= 0)
     or ($::operatingsystem == 'Fedora' and versioncmp($::operatingsystemrelease, '15') >= 0) {
-    package { 'firewalld':
-      ensure  => absent,
-      before  => Package['iptables-services'],
+    service { "firewalld":
+      ensure => stopped,
+      enable => false,
+      before => Package['iptables-services']
     }
 
     package { 'iptables-services':
index 43263fa6709f09c968171454d7787b270e48f30b..9ffab444464a9152f8af427f9a8553c7e528410f 100644 (file)
@@ -12,7 +12,7 @@ describe 'firewall::linux::redhat', :type => :class do
           :operatingsystemrelease => osrel
         }}
 
-        it { should_not contain_package('firewalld') }
+        it { should_not contain_service('firewalld') }
         it { should_not contain_package('iptables-services') }
       end
     end
@@ -24,8 +24,9 @@ describe 'firewall::linux::redhat', :type => :class do
           :operatingsystemrelease => osrel
         }}
 
-        it { should contain_package('firewalld').with(
-          :ensure => 'absent',
+        it { should contain_service('firewalld').with(
+          :ensure => 'stopped',
+          :enable => false,
           :before => 'Package[iptables-services]'
         )}