From fda986bd8597ae683c78c4baa9b69ef990796e85 Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Tue, 14 Mar 2023 12:16:51 +0100 Subject: [PATCH 1/2] Add RHEL9 to supported OS --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 7ee6941..b8751ca 100644 --- a/metadata.json +++ b/metadata.json @@ -47,7 +47,8 @@ "operatingsystemrelease": [ "6", "7", - "8" + "8", + "9" ] }, { From 361c951ecd4f3ad149f9b3e0db35abc2e35f574d Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Tue, 14 Mar 2023 12:24:34 +0100 Subject: [PATCH 2/2] ensure dnf related packages - dnf-utils on RHEL 9 - no yum-plugin-security on RHEL 9 --- manifests/init.pp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 256753d..3d78f66 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,7 @@ # User who runs the cron job # # @param manage_yum_utils [Boolean] -# Should the yum_utils package be managed by this module on RedHat family nodes? +# Should the yum_utils/dnf_utils package be managed by this module on RedHat family nodes? # If `true`, use the parameter `yum_utils` to determine how it should be manged # # @param block_patching_on_warnings [Boolean] @@ -323,9 +323,14 @@ case $facts['kernel'] { 'FreeBSD', 'Linux': { if ( $facts['os']['family'] == 'RedHat' and $manage_yum_utils) { - package { 'yum-utils': - ensure => $yum_utils, - } + if ( Integer($facts['os']['release']['major']) < 8) { + package { 'yum-utils': + ensure => $yum_utils, + } + } else { + package { 'dnf-utils': + ensure => $yum_utils, + } } if ( $facts['os']['family'] == 'RedHat' and $manage_delta_rpm) { @@ -341,7 +346,7 @@ } } - if ( $facts['os']['family'] == 'RedHat' and $manage_yum_plugin_security) { + if ( $facts['os']['family'] == 'RedHat' and $manage_yum_plugin_security and Integer($facts['os']['release']['major']) < 8 ) { package { 'yum-plugin-security': ensure => $yum_plugin_security, }