Skip to content

Commit d5ad156

Browse files
committed
[PE-37297]: Added support for amazon 2023 in redhat.pp manifest file
Optimized Amazon linux 2023 support code & tests
1 parent a3c356e commit d5ad156

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

acceptance/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || 'https://gith
2424
gem "beaker-docker", *location_for(ENV['BEAKER_DOCKER_VERSION'] || '~> 0')
2525
gem "beaker-vagrant", *location_for(ENV['BEAKER_VAGRANT_VERSION'] || '~> 0')
2626
gem "beaker-vmpooler", *location_for(ENV['BEAKER_VMPOOLER_VERSION'] || '~> 1')
27-
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 1')
27+
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 2')
2828
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0')

manifests/osfamily/redhat.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@
1818
$platform_and_version = "fedora/${facts['os']['release']['major']}"
1919
}
2020
'Amazon': {
21-
if ("${facts['os']['release']['major']}" == '2') {
22-
$amz_el_version = '7'
23-
} else {
24-
$amz_el_version = '6'
21+
$major_version = $facts['os']['release']['major']
22+
$amz_el_version = "${major_version}" ? {
23+
'2' => '7',
24+
/^(2017|2018)$/ => '6',
25+
default => $major_version,
26+
}
27+
28+
$platform_and_version = "${amz_el_version}" ? {
29+
/^(6|7)$/ => "el/${amz_el_version}",
30+
default => "amazon/${amz_el_version}",
2531
}
26-
$platform_and_version = "el/${amz_el_version}"
2732
}
2833
default: {
2934
$platform_and_version = "el/${facts['os']['release']['major']}"

spec/classes/puppet_agent_osfamily_redhat_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
end
2323

24-
[['Rocky', 'el/8', 8], ['AlmaLinux', 'el/8', 8], ['Fedora', 'fedora/f36', 36], ['CentOS', 'el/7', 7], ['Amazon', 'el/6', 2017], ['Amazon', 'el/7', 2]].each do |os, urlbit, osmajor|
24+
[['Rocky', 'el/8', 8], ['AlmaLinux', 'el/8', 8], ['Fedora', 'fedora/f36', 36], ['CentOS', 'el/7', 7], ['Amazon', 'el/6', 2017], ['Amazon', 'el/6', 2018], ['Amazon', 'el/7', 2], ['Amazon', 'amazon/2023', 2023]].each do |os, urlbit, osmajor|
2525
context "with #{os} and #{urlbit}" do
2626
let(:facts) do
2727
override_facts(super(), os: { name: os, release: { major: osmajor, }, })

0 commit comments

Comments
 (0)