Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RedHat support #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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