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 authored and ekohl committed Jan 28, 2022
1 parent 4828017 commit 6888c71
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions manifests/repo.pp
Expand Up @@ -22,4 +22,17 @@
enabled => true,
}
-> anchor { 'katello::repo': } # lint:ignore:anchor_resource

Anchor <| title == 'foreman::repo' |> -> Yumrepo['katello']

if $facts['os']['release']['major'] != '7' and ($repo_version == 'nightly' or versioncmp($repo_version, '4.3') >= 0) {
package { 'katello-dnf-module':
ensure => $dist,
name => 'katello',
enable_only => true,
provider => 'dnfmodule',
require => Yumrepo['katello'],
before => Anchor['katello::repo'],
}
}
}
24 changes: 24 additions & 0 deletions spec/classes/repo_spec.rb
Expand Up @@ -17,6 +17,8 @@
end

context 'with manage_repo => true' do
let(:facts) { { os: { release: { major: '8' } } } }

let :params do
{
'repo_version' => '3.14',
Expand All @@ -35,4 +37,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',
'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 6888c71

Please sign in to comment.