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

Implement OracleLinux support #98

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
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
18 changes: 16 additions & 2 deletions lib/puppet_metadata/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ class Beaker
'CentOS' => ['8'],
}.freeze
class << self
# modifies the operating system name to suit beaker-hostgenerator
# @param [String] os
# @return [String] the modified OS name
def adjusted_os(os)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend adjust_os_name instead but up to you

case os
when 'OracleLinux'
'oracle'
else
os.downcase
end
end

# Convert an Operating System name with a release to a Beaker setfile
#
# @param [String] os
Expand All @@ -46,7 +58,9 @@ class << self
def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: false, domain: nil, puppet_version: nil)
return unless os_supported?(os)

name = "#{os.downcase}#{release.tr('.', '')}-64"
aos = adjusted_os(os)

name = "#{aos}#{release.tr('.', '')}-64"
hostname = (puppet_version.nil? && puppet_version != 'none') ? name : "#{name}-#{puppet_version}"
domain ||= 'example.com' if use_fqdn

Expand All @@ -71,7 +85,7 @@ 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].include?(os)
%w[Archlinux CentOS Fedora Debian Ubuntu Rocky AlmaLinux OracleLinux].include?(os)
end

private
Expand Down
6 changes: 6 additions & 0 deletions lib/puppet_metadata/operatingsystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ class OperatingSystem
'2.2' => '2003-06-30',
'2.1' => '2000-09-30',
},
# https://endoflife.date/oraclelinux
'OracleLinux' => {
'9' => '2032-06-30',
'8' => '2029-07-01',
'7' => '2024-07-01',
},
# https://endoflife.software/operating-systems/linux/fedora
'Fedora' => {
'32' => nil,
Expand Down