Skip to content

Commit 8d062b8

Browse files
authored
Merge pull request #806 from puppetlabs/fedora41
(PE-42492) Use dnf on fedora >= 41
2 parents 306809a + 44234af commit 8d062b8

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.fixtures.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ fixtures:
22
repositories:
33
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
44
apt: https://github.com/puppetlabs/puppetlabs-apt.git
5-
inifile: https://github.com/puppetlabs/puppetlabs-inifile.git
5+
inifile:
6+
repo: https://github.com/puppetlabs/puppetlabs-inifile.git
7+
ref: "v6.2.0"
68
yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
79
facts: https://github.com/puppetlabs/puppetlabs-facts.git

manifests/install.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@
9393
# any other type of source means we use a package manager (yum) with no 'source' parameter in the
9494
# package resource below
9595
$_package_version = $package_version
96-
$_provider = 'yum'
96+
if $facts['os']['name'] == 'Fedora' and versioncmp($facts['os']['release']['major'], '41') {
97+
$_provider = undef
98+
} else {
99+
$_provider = 'yum'
100+
}
97101
$_source = undef
98102
}
99103
}

spec/classes/puppet_agent_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,26 @@ def global_facts(facts, os)
119119
end
120120
end
121121

122+
context 'package provider' do
123+
# module is still pinned to older rspec-puppet and facterdb
124+
os_name = 'fedora-41-x86_64'
125+
os_facts = {
126+
os_name => on_supported_os['fedora-39-x86_64'],
127+
}
128+
os_facts.values.first[:os]['release'] = { 'full' => '41', 'major' => '41' }
129+
os_facts.each do |os, facts|
130+
context "on #{os}" do
131+
let(:facts) do
132+
global_facts(facts, os)
133+
end
134+
135+
let(:params) { { package_version: '6.18.0' } }
136+
137+
it { is_expected.to contain_package('puppet-agent').with_provider(nil) }
138+
end
139+
end
140+
end
141+
122142
context 'supported_operating systems' do
123143
on_supported_os.each do |os, facts|
124144
context "on #{os}" do

0 commit comments

Comments
 (0)