From 45d7379f83d36bb1bea425a4b7877595605e2a85 Mon Sep 17 00:00:00 2001 From: rpaliwal Date: Tue, 11 Feb 2025 17:29:54 +0530 Subject: [PATCH 1/2] fix(php): PHP installation failures with al2023/rhel --- recipes/newrelic/apm/php/redhat.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/recipes/newrelic/apm/php/redhat.yml b/recipes/newrelic/apm/php/redhat.yml index fa3ae24ca..269a08edb 100644 --- a/recipes/newrelic/apm/php/redhat.yml +++ b/recipes/newrelic/apm/php/redhat.yml @@ -351,20 +351,25 @@ install: vars: AGENT_VERSION: "9.17.1.301" - + install_rpm: cmds: - | echo -e "{{.ARROW}}Adding the New Relic PHP Agent repository{{.GRAY}}" - # The repo install command returns a non-zero return code if it is already installed - # Only attempt an install if it is needed - if rpm -q newrelic-repo-5-3.noarch > /dev/null; then - echo -e "The New Relic repository is already installed." + # Skip this task if the host machine is Amazon Linux 2023 + if grep -q "Amazon Linux release 2023" /etc/system-release; then + echo -e "Skipping repository installation on Amazon Linux 2023." else - echo -e "Adding the New Relic PHP Agent repository." - sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm + # The repo install command returns a non-zero return code if it is already installed + # Only attempt an install if it is needed + if rpm -q newrelic-repo-5-3.noarch > /dev/null; then + echo -e "The New Relic repository is already installed." + else + echo -e "Adding the New Relic PHP Agent repository." + sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm + fi + sudo yum install -y newrelic-php5 fi - sudo yum install -y newrelic-php5 configure: cmds: From 4bfa9d022abd7218bd0753adab1b325b6abde706 Mon Sep 17 00:00:00 2001 From: rpaliwal Date: Mon, 17 Feb 2025 14:27:01 +0530 Subject: [PATCH 2/2] fix(php): Updated the logging message --- recipes/newrelic/apm/php/redhat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/newrelic/apm/php/redhat.yml b/recipes/newrelic/apm/php/redhat.yml index 269a08edb..ee0f89b83 100644 --- a/recipes/newrelic/apm/php/redhat.yml +++ b/recipes/newrelic/apm/php/redhat.yml @@ -358,7 +358,7 @@ install: echo -e "{{.ARROW}}Adding the New Relic PHP Agent repository{{.GRAY}}" # Skip this task if the host machine is Amazon Linux 2023 if grep -q "Amazon Linux release 2023" /etc/system-release; then - echo -e "Skipping repository installation on Amazon Linux 2023." + echo -e "Skipping repository installation on Amazon Linux 2023. The RPM method is not supported on this version." else # The repo install command returns a non-zero return code if it is already installed # Only attempt an install if it is needed