Skip to content

Commit 5930e9e

Browse files
authored
Merge pull request #22 from amitkarsale/PE-38404
(PE-38404) Install script for AL2
2 parents 257c354 + 941a139 commit 5930e9e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

install.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ case $platform in
521521
;;
522522
"Amzn"|"Amazon Linux")
523523
case $platform_version in
524-
"2") platform_version="7";;
524+
"2") platform_version="2";;
525525
esac
526526
;;
527527
esac
@@ -789,10 +789,15 @@ install_file() {
789789
fi
790790

791791
rpm -Uvh --oldpackage --replacepkgs "$2"
792+
if exists dnf; then
793+
PKGCMD=dnf
794+
else
795+
PKGCMD=yum
796+
fi
792797
if test "$version" = 'latest'; then
793-
run_cmd "yum install -y puppet-agent && yum upgrade -y puppet-agent"
798+
run_cmd "${PKGCMD} install -y puppet-agent && ${PKGCMD} upgrade -y puppet-agent"
794799
else
795-
run_cmd "yum install -y 'puppet-agent-${puppet_agent_version}'"
800+
run_cmd "${PKGCMD} install -y 'puppet-agent-${puppet_agent_version}'"
796801
fi
797802
;;
798803
"noarch.rpm")
@@ -897,7 +902,7 @@ case $platform in
897902
filetype="rpm"
898903
platform_package="el"
899904
# For Amazon Linux 2023 and onwards we can use the 'amazon' packages created instead of 'el' packages
900-
if (( $platform_version >= 2023 )); then
905+
if (( $platform_version >= 2 )); then
901906
platform_package="amazon"
902907
fi
903908
filename="${collection}-release-${platform_package}-${platform_version}.noarch.rpm"

0 commit comments

Comments
 (0)