Skip to content

Commit

Permalink
(PA-6677) Restore support for AL2 x86_64 install_shell task
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshcooper committed Jun 24, 2024
1 parent 3d160da commit eddc84a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tasks/install_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,6 @@ case $platform in
"SLES")
platform_version=$major_version
;;
"Amzn"|"Amazon Linux")
case $platform_version in
"2") platform_version="2";;
esac
;;
esac

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

0 comments on commit eddc84a

Please sign in to comment.