diff --git a/.fixtures.yml b/.fixtures.yml index 1c744c9a..f83777e7 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -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 diff --git a/manifests/install.pp b/manifests/install.pp index eed05ca6..2a2988d8 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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' + if $facts['os']['name'] == 'Fedora' and versioncmp($facts['os']['release']['major'], '41') { + $_provider = undef + } else { + $_provider = 'yum' + } $_source = undef } } diff --git a/spec/classes/puppet_agent_spec.rb b/spec/classes/puppet_agent_spec.rb index bdf47f1c..822e6608 100644 --- a/spec/classes/puppet_agent_spec.rb +++ b/spec/classes/puppet_agent_spec.rb @@ -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