Skip to content

Commit

Permalink
enable dnf module for 4.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 27, 2022
1 parent 4828017 commit e0556e3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@
enabled => true,
}
-> anchor { 'katello::repo': } # lint:ignore:anchor_resource

if $facts['os']['release']['major'] == '8' and ($repo_version == 'nightly' or versioncmp($repo_version, '4.3') >= 0) {
package { 'katello-dnf-module':
ensure => "el${facts['os']['release']['major']}",
package => 'katello',
enable_only => true,
provider => 'dnfmodule',
require => Yumrepo['katello'],
}
}
}
22 changes: 22 additions & 0 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,26 @@
.with_enabled(true)
end
end
context 'with manage_repo => true on EL8 with modular metadata' do
let(:facts) { { os: { release: { major: '8' } } } }
let :params do
{
'repo_version' => 'nightly',
'dist' => 'el8',
'gpgcheck' => false,
}
end

it do
is_expected.to contain_yumrepo('katello')
.with_descr('katello nightly')
.with_baseurl("https://yum.theforeman.org/katello/nightly/katello/el8/\$basearch/")
.with_gpgcheck(false)
.with_enabled(true)

is_expected.to contain_package('katello-dnf-module')
.with_ensure('el8')
.with_provider('dnfmodule')
end
end
end

0 comments on commit e0556e3

Please # to comment.