Skip to content

Commit

Permalink
(PE-38404) Install script for AL2
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkarsale committed Jun 12, 2024
1 parent 257c354 commit 941a139
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ case $platform in
;;
"Amzn"|"Amazon Linux")
case $platform_version in
"2") platform_version="7";;
"2") platform_version="2";;
esac
;;
esac
Expand Down Expand Up @@ -789,10 +789,15 @@ install_file() {
fi

rpm -Uvh --oldpackage --replacepkgs "$2"
if exists dnf; then
PKGCMD=dnf
else
PKGCMD=yum
fi
if test "$version" = 'latest'; then
run_cmd "yum install -y puppet-agent && yum upgrade -y puppet-agent"
run_cmd "${PKGCMD} install -y puppet-agent && ${PKGCMD} upgrade -y puppet-agent"
else
run_cmd "yum install -y 'puppet-agent-${puppet_agent_version}'"
run_cmd "${PKGCMD} install -y 'puppet-agent-${puppet_agent_version}'"
fi
;;
"noarch.rpm")
Expand Down Expand Up @@ -897,7 +902,7 @@ case $platform in
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 )); then
if (( $platform_version >= 2 )); then
platform_package="amazon"
fi
filename="${collection}-release-${platform_package}-${platform_version}.noarch.rpm"
Expand Down

0 comments on commit 941a139

Please sign in to comment.