Skip to content

Commit

Permalink
Merge pull request #98 from bastelfreak/oraclelinux
Browse files Browse the repository at this point in the history
Implement OracleLinux support
  • Loading branch information
ekohl committed Aug 8, 2023
2 parents 0d65dce + 7dd3f64 commit ceb13df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
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)
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

0 comments on commit ceb13df

Please sign in to comment.