Skip to content

Commit

Permalink
foreman::repo: use the package resource 'ensure' parameter to specify…
Browse files Browse the repository at this point in the history
… the desired ruby stream

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
Co-authored-by: pkranenburg <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2022
1 parent 2f60b88 commit bb6e115
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
}

if $facts['os']['release']['major'] == '8' and ($repo == 'nightly' or versioncmp($repo, '2.5') >= 0) {
package { 'ruby:2.7':
ensure => installed,
package { 'ruby':
ensure => '2.7',
enable_only => true,
provider => 'dnfmodule',
}
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/foreman_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

it do
if facts[:operatingsystemmajrelease] == '8'
is_expected.to contain_package('ruby:2.7')
is_expected.to contain_package('ruby').with_ensure('2.7').with_provider('dnfmodule')
else
is_expected.not_to contain_package('ruby:2.7')
is_expected.not_to contain_package('ruby')
end
end
end
Expand All @@ -67,7 +67,7 @@
it { is_expected.not_to contain_package('centos-release-scl-rh') }

it do
is_expected.not_to contain_package('ruby:2.7')
is_expected.not_to contain_package('ruby')
end
end

Expand All @@ -83,9 +83,9 @@

it do
if facts[:operatingsystemmajrelease] == '8'
is_expected.to contain_package('ruby:2.7')
is_expected.to contain_package('ruby').with_ensure('2.7').with_provider('dnfmodule')
else
is_expected.not_to contain_package('ruby:2.7')
is_expected.not_to contain_package('ruby')
end
end
end
Expand Down

0 comments on commit bb6e115

Please sign in to comment.