Skip to content

Commit

Permalink
Add RedHat support
Browse files Browse the repository at this point in the history
RedHat 7 is excluded because the UBI yum repos are unable to resolve
all EPEL dependencies (try installing nginx from epel).
  • Loading branch information
h0tw1r3 committed Mar 14, 2024
1 parent ca6a320 commit bcec08e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/puppet_metadata/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Beaker
# unit files
PIDFILE_INCOMPATIBLE = {
'CentOS' => ['8'],
'RedHat' => ['8'],
'AlmaLinux' => ['8'],
'OracleLinux' => ['7', '8'],
'Rocky' => ['8'],
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bcec08e

Please sign in to comment.