From bcec08ef82fe2a321d85d00f1e37458936022c9a Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Wed, 13 Mar 2024 01:28:56 -0500 Subject: [PATCH] Add RedHat support RedHat 7 is excluded because the UBI yum repos are unable to resolve all EPEL dependencies (try installing nginx from epel). --- lib/puppet_metadata/beaker.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/puppet_metadata/beaker.rb b/lib/puppet_metadata/beaker.rb index 8f55cfb..cdecefd 100644 --- a/lib/puppet_metadata/beaker.rb +++ b/lib/puppet_metadata/beaker.rb @@ -19,6 +19,7 @@ class Beaker # unit files PIDFILE_INCOMPATIBLE = { 'CentOS' => ['8'], + 'RedHat' => ['8'], 'AlmaLinux' => ['8'], 'OracleLinux' => ['7', '8'], 'Rocky' => ['8'], @@ -59,7 +60,7 @@ def adjusted_os(os) # @return [nil] If no setfile is available # @return [Array<(String, String)>] The beaker setfile description with a readable name def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: false, domain: nil, puppet_version: nil) - return unless os_supported?(os) + return unless os_supported?(os, release) aos = adjusted_os(os) @@ -87,8 +88,14 @@ def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: fals # Return whether a Beaker setfile can be generated for the given OS # @param [String] os The operating system - def os_supported?(os) - %w[Archlinux CentOS Fedora Debian Ubuntu Rocky AlmaLinux OracleLinux].include?(os) + # @param [String] release The operating system release + def os_supported?(os, release = nil) + case os + when 'RedHat' + true unless /^7/.match?(release) + when /^(Archlinux|CentOS|Fedora|Debian|Ubuntu|Rocky|AlmaLinux|OracleLinux)/ + true + end end private