From 850a27c947e69820f07d1d54ca9f9061f87cc441 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 16 Feb 2024 21:30:37 +0100 Subject: [PATCH 1/3] Correct assertion that the DNF module is not managed Since 95f2b4d8b5f7ec9dc865188ba21321a234fcfbae we only manage the foreman dnf module, not the ruby module. That means the assertion was never true. Fixes: 95f2b4d8b5f7ec9dc865188ba21321a234fcfbae ("Drop EL7 support") --- spec/classes/foreman_repo_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/foreman_repo_spec.rb b/spec/classes/foreman_repo_spec.rb index 251fcd0b7..3394d764c 100644 --- a/spec/classes/foreman_repo_spec.rb +++ b/spec/classes/foreman_repo_spec.rb @@ -25,7 +25,7 @@ if facts[:osfamily] == 'RedHat' is_expected.to contain_package('foreman').with_ensure('el8').with_provider('dnfmodule') else - is_expected.not_to contain_package('ruby') + is_expected.not_to contain_package('foreman') end end end From 211b26607a355e4467776c0035c3ec04131480c7 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 16 Feb 2024 21:33:45 +0100 Subject: [PATCH 2/3] Only expect the DNF module on EL8 This matches the test expectations to the actual code. Fixes: 908ed638790f3cfc6e2f5f62e1b023c907a9913c ("Only install dnf module on EL8") --- spec/classes/foreman_repo_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/foreman_repo_spec.rb b/spec/classes/foreman_repo_spec.rb index 3394d764c..9a0269e2d 100644 --- a/spec/classes/foreman_repo_spec.rb +++ b/spec/classes/foreman_repo_spec.rb @@ -22,7 +22,7 @@ } it do - if facts[:osfamily] == 'RedHat' + if facts[:osfamily] == 'RedHat' && facts[:os]['release']['major'] == '8' is_expected.to contain_package('foreman').with_ensure('el8').with_provider('dnfmodule') else is_expected.not_to contain_package('foreman') From ed4c9ecf0b4c16e7afae835f591aa95008176b13 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 16 Feb 2024 21:14:38 +0100 Subject: [PATCH 3/3] Support EL9 --- metadata.json | 6 ++++-- spec/acceptance/foreman_cli_plugins_spec.rb | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/metadata.json b/metadata.json index 3879c8e72..96f9c6c24 100644 --- a/metadata.json +++ b/metadata.json @@ -55,13 +55,15 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "8" + "8", + "9" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "8" + "8", + "9" ] }, { diff --git a/spec/acceptance/foreman_cli_plugins_spec.rb b/spec/acceptance/foreman_cli_plugins_spec.rb index 1f8ec0701..51ef1fcae 100644 --- a/spec/acceptance/foreman_cli_plugins_spec.rb +++ b/spec/acceptance/foreman_cli_plugins_spec.rb @@ -68,13 +68,15 @@ class { 'foreman::cli': gpgcheck => 0, } - package { 'katello': - ensure => "el${facts['os']['release']['major']}", - enable_only => true, - provider => 'dnfmodule', - require => Yumrepo['katello'], + if $facts['os']['release']['major'] == '8' { + package { 'katello': + ensure => "el${facts['os']['release']['major']}", + enable_only => true, + provider => 'dnfmodule', + require => Yumrepo['katello'], + } + Package['katello'] -> Class['foreman::cli::katello'] } - Package['katello'] -> Class['foreman::cli::katello'] class { 'foreman::cli': foreman_url => 'https://foreman.example.com',