From: Martin Mágr Date: Fri, 24 Oct 2014 07:37:01 +0000 (+0200) Subject: Fixed firewalld package issue X-Git-Tag: 1.2.0~1^2^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=829cf269cd0e7c72931e97d151fcb48505933be1;p=puppet-modules%2Fpuppetlabs-firewall.git Fixed firewalld package issue 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 --- diff --git a/manifests/linux/redhat.pp b/manifests/linux/redhat.pp index b7a4d0e..c808c7e 100644 --- a/manifests/linux/redhat.pp +++ b/manifests/linux/redhat.pp @@ -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': diff --git a/spec/unit/classes/firewall_linux_redhat_spec.rb b/spec/unit/classes/firewall_linux_redhat_spec.rb index 43263fa..9ffab44 100644 --- a/spec/unit/classes/firewall_linux_redhat_spec.rb +++ b/spec/unit/classes/firewall_linux_redhat_spec.rb @@ -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]' )}