Skip to content

Commit

Permalink
Ensure maven:3.8 is enabled on EL8
Browse files Browse the repository at this point in the history
The maven 3.5 and 3.6 modules are no longer supported on RHEL.
  • Loading branch information
ehelms committed Jul 19, 2023
1 parent dfbeff6 commit 5f4c86e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
# Disable FIPS within the Java environment for Tomcat explicitly.
# When set to false, no flag is added. Then on FIPS enabled systems, a Candlepin build that supports FIPS is required.
#
# @param maven_module_version
# Version of the maven module to use
#
# @example Set debug logging
# class { 'candlepin':
# loggers => {
Expand Down Expand Up @@ -233,6 +236,7 @@
String $user = 'tomcat',
String $group = 'tomcat',
Boolean $disable_fips = true,
String $maven_module_version = '3.8',
) inherits candlepin::params {
contain candlepin::service

Expand Down
8 changes: 8 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
}

if $enable_pki_core {
package { 'maven dnf module':
ensure => $candlepin::maven_module_version,
name => 'maven',
enable_only => true,
provider => 'dnfmodule',
before => Package['pki-core'],
}

package { 'pki-core':
ensure => installed,
enable_only => true,
Expand Down
16 changes: 16 additions & 0 deletions spec/acceptance/dnf_module_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper_acceptance'

describe 'dnf module support' do
context 'when swapping to maven 3.8' do
before(:context) do
on default, 'dnf module reset maven -y'
on default, 'dnf module enable maven:3.5 -y'
end

include_examples 'the example', 'basic_candlepin.pp'

describe command('dnf module list --enabled --quiet') do
its(:stdout) { is_expected.to include('pki-core').and match(/^maven\s+3\.8/) }
end
end
end
6 changes: 6 additions & 0 deletions spec/classes/candlepin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
it { is_expected.to contain_package('candlepin').with_ensure('present') }
it { is_expected.not_to contain_package('wget') }
it { is_expected.to contain_package('pki-core').that_comes_before('Package[candlepin]') }
it do
is_expected.to contain_package('maven dnf module').
with_ensure('3.8').
with_name('maven').
that_comes_before('Package[pki-core]')
end

# config
it { is_expected.to contain_class('candlepin::config') }
Expand Down

0 comments on commit 5f4c86e

Please sign in to comment.