Skip to content

Commit 8f13676

Browse files
committed
(PA-6677) Restore support for AL2 x86_64 install_shell task
Commit bf467db fixed AL2 aarch64, but broke AL2 x86_64 causing the task to install the `puppetN-release-amazon-2.noarch.rpm` release package, but later the `yum install puppet-agent` command failed, since there are no AL2 x86_64 builds. It also broke future releases of amazon, so the hypothetical AL 2025 would fallback to el-2025. This commit results on the following mapping: AL2 x86_64 -> puppetN-release-el-7.noarch.rpm AL2 aarch64 -> puppetN-release-amazon-2.noarch.rpm AL2023 (all) -> puppetN-release-amazon-2023.noarch.rpm And ensures future AL releases work as expected.
1 parent 610b6da commit 8f13676

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

manifests/osfamily/redhat.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# lint:endignore
4040
if ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) {
4141
$pe_server_version = pe_build_version()
42-
# Install amazon packages on AL2 (only aarch64) and 2003 and up (all arch)
42+
# Install amazon packages on AL2 (only aarch64) and 2023 and up (all arch)
4343
if $facts['os']['name'] == 'Amazon' {
4444
# lint:ignore:only_variable_string
4545
$pe_repo_dir = "${amz_el_version}" ? {

tasks/install_shell.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,6 @@ case $platform in
284284
"SLES")
285285
platform_version=$major_version
286286
;;
287-
"Amzn"|"Amazon Linux")
288-
case $platform_version in
289-
"2") platform_version="2";;
290-
esac
291-
;;
292287
esac
293288

294289
# Find which version of puppet is currently installed if any
@@ -662,8 +657,11 @@ case $platform in
662657
info "Amazon platform! Lets get you an RPM..."
663658
filetype="rpm"
664659
platform_package="el"
665-
# For Amazon Linux 2023 and onwards we can use the 'amazon' packages created instead of 'el' packages
666-
if (( $platform_version == 2023 || $platform_version == 2 )); then
660+
arch="$(uname -p)"
661+
# Install amazon packages on AL2 (only aarch64) and 2003 and up (all arch)
662+
if [[ $platform_version == 2 && $arch == 'x86_64' ]]; then
663+
platform_version="7"
664+
elif (( platform_version == 2 || platform_version >= 2023 )); then
667665
platform_package="amazon"
668666
fi
669667
filename="${collection}-release-${platform_package}-${platform_version}.noarch.rpm"

0 commit comments

Comments
 (0)