Skip to content

Commit

Permalink
Fix compilation on Fedora
Browse files Browse the repository at this point in the history
Prior to voxpupuli#95 including `epel` on
Fedora was a no-op. This commit restores this behaviour.
  • Loading branch information
alexjfisher committed Mar 28, 2020
1 parent e2762c2 commit 7be8927
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
Boolean $epel_gpg_managed = true,
$os_maj_release = $epel::params::os_maj_release,
) inherits epel::params {
if $facts['os']['family'] == 'RedHat' {
if $facts['os']['family'] == 'RedHat' and $facts['os']['name'] != 'Fedora' {
if $epel_testing_managed {
yumrepo { 'epel-testing':
# lint:ignore:selector_inside_resource
Expand Down
27 changes: 27 additions & 0 deletions spec/classes/epel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,31 @@
end
end
end
context 'on unsupported OSes' do
# On Fedora and other non RedHat systems, including `epel` is a no-op, but should still compile.
test_on = {
supported_os: [ # Unfortunate misnomer
{
'operatingsystem' => 'Fedora',
'operatingsystemrelease' => %w[28 29 30]
},
{
'operatingsystem' => 'Debian',
'operatingsystemrelease' => %w[8 9 10]
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => %w[16.04 18.04]
}
]
}
on_supported_os(test_on).each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }

it { is_expected.to contain_class('epel') }
it { is_expected.to have_resource_count(0) }
end
end
end
end

0 comments on commit 7be8927

Please sign in to comment.