diff --git a/lib/puppet_metadata/beaker.rb b/lib/puppet_metadata/beaker.rb index ebe40f2..ea327fb 100644 --- a/lib/puppet_metadata/beaker.rb +++ b/lib/puppet_metadata/beaker.rb @@ -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 @@ -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 @@ -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 diff --git a/lib/puppet_metadata/operatingsystem.rb b/lib/puppet_metadata/operatingsystem.rb index 1a5d165..59a8560 100644 --- a/lib/puppet_metadata/operatingsystem.rb +++ b/lib/puppet_metadata/operatingsystem.rb @@ -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,