Skip to content

Commit

Permalink
[PE-37297]: Optimized Amazon linux 2023 support code
Browse files Browse the repository at this point in the history
  • Loading branch information
span786 committed Dec 26, 2023
1 parent b94cfb4 commit d7fd990
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions manifests/osfamily/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
}
'Amazon': {
$major_version = $facts['os']['release']['major']
if ("${major_version}" == '2') {
$amz_el_version = '7'
}
else {
$amz_el_version = '6'
$amz_el_version = "${major_version}" ? {
'2' => '7',
'2017' => '6',
default => $major_version,
}

if ("${amz_el_version}" =~ /^(\A6\z|\A7\z)/) {
$platform_and_version = "el/${amz_el_version}"
}
else {
$platform_and_version = "amazon/${major_version}"
$platform_and_version = "${amz_el_version}" ? {
/^(6|7)$/ => "el/${amz_el_version}",
default => "amazon/${amz_el_version}",
}
}
default: {
Expand Down

0 comments on commit d7fd990

Please sign in to comment.