From 941a1399395107ccd8b4442908856a6fac68581e Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Wed, 12 Jun 2024 10:22:29 +0530 Subject: [PATCH] (PE-38404) Install script for AL2 --- install.sh | 13 +++++++++---- modules/puppet_agent | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index e0d2ea6..158b982 100755 --- a/install.sh +++ b/install.sh @@ -521,7 +521,7 @@ case $platform in ;; "Amzn"|"Amazon Linux") case $platform_version in - "2") platform_version="7";; + "2") platform_version="2";; esac ;; esac @@ -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") @@ -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" diff --git a/modules/puppet_agent b/modules/puppet_agent index ba01fdb..89688c8 160000 --- a/modules/puppet_agent +++ b/modules/puppet_agent @@ -1 +1 @@ -Subproject commit ba01fdb177ca3762390f14078806f5492a7effa8 +Subproject commit 89688c83ad099776c2022ba5282b6c13b453d601