From: Romain Tartière Date: Thu, 26 Aug 2021 17:34:27 +0000 (-1000) Subject: (IAC-1741) Prefer 'installed' to 'present' for packages X-Git-Tag: v3.2.0~3^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a8cd80e5c57191b3e03782b5238f408d4f6e490c;p=puppet-modules%2Fpuppetlabs-firewall.git (IAC-1741) Prefer 'installed' to 'present' for packages stdlib 8.0.0 fixed this value for `ensure_package`, so we have to sync with it. While here, also use `installed` for package resources. Because 'present' is still something that works, this is not a breaking change. --- diff --git a/manifests/linux.pp b/manifests/linux.pp index ff98400..1ceadbe 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -7,7 +7,7 @@ # Controls the state of the ipv6 iptables service on your system. Valid options: 'running' or 'stopped'. Defaults to 'running'. # # @param pkg_ensure -# Controls the state of the iptables package on your system. Valid options: 'present' or 'latest'. Defaults to 'latest'. +# Controls the state of the iptables package on your system. Valid options: 'installed' or 'latest'. Defaults to 'latest'. # # @param service_name # Specify the name of the IPv4 iptables service. Defaults defined in firewall::params. @@ -26,7 +26,7 @@ class firewall::linux ( $ensure = running, $ensure_v6 = undef, - $pkg_ensure = present, + $pkg_ensure = installed, $service_name = $firewall::params::service_name, $service_name_v6 = $firewall::params::service_name_v6, $package_name = $firewall::params::package_name, diff --git a/spec/unit/classes/firewall_linux_debian_spec.rb b/spec/unit/classes/firewall_linux_debian_spec.rb index 4f74d21..7383351 100644 --- a/spec/unit/classes/firewall_linux_debian_spec.rb +++ b/spec/unit/classes/firewall_linux_debian_spec.rb @@ -14,7 +14,7 @@ describe 'firewall::linux::debian', type: :class do it { is_expected.to contain_package('iptables-persistent').with( - ensure: 'present', + ensure: 'installed', ) } it { @@ -54,7 +54,7 @@ describe 'firewall::linux::debian', type: :class do it { is_expected.to contain_package('iptables-persistent').with( - ensure: 'present', + ensure: 'installed', ) } it { @@ -94,7 +94,7 @@ describe 'firewall::linux::debian', type: :class do it { is_expected.to contain_package('iptables-persistent').with( - ensure: 'present', + ensure: 'installed', ) } it { @@ -134,7 +134,7 @@ describe 'firewall::linux::debian', type: :class do it { is_expected.to contain_package('netfilter-persistent').with( - ensure: 'present', + ensure: 'installed', ) } it { diff --git a/spec/unit/classes/firewall_linux_redhat_spec.rb b/spec/unit/classes/firewall_linux_redhat_spec.rb index d9b720d..5055acb 100644 --- a/spec/unit/classes/firewall_linux_redhat_spec.rb +++ b/spec/unit/classes/firewall_linux_redhat_spec.rb @@ -141,7 +141,7 @@ describe 'firewall::linux::redhat', type: :class do it { is_expected.to contain_package('iptables-services').with( - ensure: 'present', + ensure: 'installed', before: 'Service[iptables]', ) } @@ -209,14 +209,14 @@ describe 'firewall::linux::redhat', type: :class do it { is_expected.to contain_package('iptables-services').with( - ensure: 'present', + ensure: 'installed', before: ['Service[iptables]', 'Service[nftables]'], ) } it { is_expected.to contain_package('nftables').with( - ensure: 'present', + ensure: 'installed', before: ['Service[iptables]', 'Service[nftables]'], ) } diff --git a/spec/unit/classes/firewall_linux_spec.rb b/spec/unit/classes/firewall_linux_spec.rb index b45982e..4239104 100644 --- a/spec/unit/classes/firewall_linux_spec.rb +++ b/spec/unit/classes/firewall_linux_spec.rb @@ -20,7 +20,7 @@ describe 'firewall::linux', type: :class do end it { is_expected.to contain_class('firewall::linux::redhat').with_require('Package[iptables]') } - it { is_expected.to contain_package('iptables').with_ensure('present') } + it { is_expected.to contain_package('iptables').with_ensure('installed') } end end end @@ -42,7 +42,7 @@ describe 'firewall::linux', type: :class do end it { is_expected.to contain_class('firewall::linux::debian').with_require('Package[iptables]') } - it { is_expected.to contain_package('iptables').with_ensure('present') } + it { is_expected.to contain_package('iptables').with_ensure('installed') } end end end