Skip to content
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
4 changes: 3 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ fixtures:
repositories:
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
apt: https://github.com/puppetlabs/puppetlabs-apt.git
inifile: https://github.com/puppetlabs/puppetlabs-inifile.git
inifile:
repo: https://github.com/puppetlabs/puppetlabs-inifile.git
ref: "v6.2.0"
yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
facts: https://github.com/puppetlabs/puppetlabs-facts.git
6 changes: 5 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
# any other type of source means we use a package manager (yum) with no 'source' parameter in the
# package resource below
$_package_version = $package_version
$_provider = 'yum'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even have to set the provider? Can't we use undef?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it unspecified makes sense in general.. but it's been this way for so long, I didn't want to break anything. This is especially true because when doing an agent upgrade from 6.x to 8.x, we run the 6.x version of the provider to perform the upgrade. If we switch to dnf, then we have to be sure dnf in puppet 6.x works when upgrading to 8.x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be fine using undef for fedora 41 and up. It doesn't work now, so no harm in changing it.

if $facts['os']['name'] == 'Fedora' and versioncmp($facts['os']['release']['major'], '41') {
$_provider = undef
} else {
$_provider = 'yum'
}
$_source = undef
}
}
Expand Down
20 changes: 20 additions & 0 deletions spec/classes/puppet_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ def global_facts(facts, os)
end
end

context 'package provider' do
# module is still pinned to older rspec-puppet and facterdb
os_name = 'fedora-41-x86_64'
os_facts = {
os_name => on_supported_os['fedora-39-x86_64'],
}
os_facts.values.first[:os]['release'] = { 'full' => '41', 'major' => '41' }
os_facts.each do |os, facts|
context "on #{os}" do
let(:facts) do
global_facts(facts, os)
end

let(:params) { { package_version: '6.18.0' } }

it { is_expected.to contain_package('puppet-agent').with_provider(nil) }
end
end
end

context 'supported_operating systems' do
on_supported_os.each do |os, facts|
context "on #{os}" do
Expand Down
Loading