Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default package versions to installed instead of present #701

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
#
class foreman_proxy (
String $version = 'present',
Enum['latest', 'present', 'installed', 'absent'] $ensure_packages_version = 'present',
Enum['latest', 'present', 'installed', 'absent'] $ensure_packages_version = 'installed',
Variant[Array[String], String] $bind_host = ['*'],
Stdlib::Port $http_port = 8000,
Stdlib::Port $ssl_port = 8443,
Expand Down
2 changes: 1 addition & 1 deletion manifests/tftp/netboot.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Enum['redhat', 'debian', 'none'] $grub_installation_type = $foreman_proxy::tftp::netboot::params::grub_installation_type,
String $grub_modules = $foreman_proxy::tftp::netboot::params::grub_modules,
) inherits foreman_proxy::tftp::netboot::params {
ensure_packages($packages, { ensure => 'present', })
ensure_packages($packages, { ensure => 'installed', })

# The symlink from grub2/boot to boot is needed for UEFI HTTP boot
file {"${root}/grub2/boot":
Expand Down
12 changes: 6 additions & 6 deletions spec/classes/foreman_proxy__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
end

it 'should not install wget' do
should_not contain_package('wget').with_ensure('present')
should_not contain_package('wget').with_ensure('installed')
end

it "should create the #{proxy_user_name} user" do
Expand Down Expand Up @@ -455,11 +455,11 @@
.with_user(proxy_user_name)
.with_root(tftp_root)
.with_manage_wget(true)
.with_wget_version('present')
.with_wget_version('installed')
end

it 'should install wget' do
should contain_package('wget').with_ensure('present')
should contain_package('wget').with_ensure('installed')
end

context 'with custom tftp parameters' do
Expand Down Expand Up @@ -625,14 +625,14 @@
let(:params) { super().merge(dns_provider: 'nsupdate') }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('present') }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('installed') }
it { is_expected.to contain_class('foreman_proxy::proxydns') }

context 'dns_managed => false' do
let(:params) { super().merge(dns_managed: false) }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('present') }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('installed') }
it { is_expected.not_to contain_class('foreman_proxy::proxydns') }
end
end
Expand All @@ -641,7 +641,7 @@
let(:params) { super().merge(dns_provider: 'nsupdate_gss') }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('present') }
it { is_expected.to contain_package(nsupdate_pkg).with_ensure('installed') }
it { is_expected.to contain_class('foreman_proxy::proxydns') }

it 'should contain dns_tsig_* settings' do
Expand Down
12 changes: 6 additions & 6 deletions spec/classes/foreman_proxy__tftp__netboot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

if facts[:osfamily] == 'Debian'
it { is_expected.to contain_class('foreman_proxy::tftp::netboot').with_grub_installation_type('debian') }
it { should contain_package('grub-common').with_ensure('present') }
it { should contain_package('grub-efi-amd64-bin').with_ensure('present') }
it { should contain_package('grub-common').with_ensure('installed') }
it { should contain_package('grub-efi-amd64-bin').with_ensure('installed') }

it 'should generate efi image from grub2 modules for Debian' do
should contain_exec('build-grub2-efi-image').with_unless("/bin/grep -q regexp '/tftproot/grub2/grubx64.efi'")
Expand All @@ -34,10 +34,10 @@
it { should contain_file("/tftproot/grub2/shim.efi").with_ensure('link') }
elsif facts[:osfamily] == 'RedHat'
it { is_expected.to contain_class('foreman_proxy::tftp::netboot').with_grub_installation_type('redhat') }
it { should contain_package('grub2-efi-x64').with_ensure('present') }
it { should contain_package('grub2-efi-x64-modules').with_ensure('present') }
it { should contain_package('grub2-tools').with_ensure('present') }
it { should contain_package('shim-x64').with_ensure('present') }
it { should contain_package('grub2-efi-x64').with_ensure('installed') }
it { should contain_package('grub2-efi-x64-modules').with_ensure('installed') }
it { should contain_package('grub2-tools').with_ensure('installed') }
it { should contain_package('shim-x64').with_ensure('installed') }

case facts[:operatingsystem]
when /^(RedHat|Scientific|OracleLinux)$/
Expand Down