From 45d7379f83d36bb1bea425a4b7877595605e2a85 Mon Sep 17 00:00:00 2001 From: rpaliwal Date: Tue, 11 Feb 2025 17:29:54 +0530 Subject: [PATCH 1/3] 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/3] 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 From 743a7d8f4f968c526c1d592e5cba703362e78a2e Mon Sep 17 00:00:00 2001 From: rpaliwal Date: Tue, 25 Feb 2025 14:14:25 +0530 Subject: [PATCH 3/3] fix(python): Fixed ec2 provisioning issue --- .../python/install/rhel/roles/configure/tasks/main.yml | 10 ++++++---- test/manual/definitions/apm/python/python-al2.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/deploy/linux/python/install/rhel/roles/configure/tasks/main.yml b/test/deploy/linux/python/install/rhel/roles/configure/tasks/main.yml index ab84bb6e3..8ad0b4cef 100644 --- a/test/deploy/linux/python/install/rhel/roles/configure/tasks/main.yml +++ b/test/deploy/linux/python/install/rhel/roles/configure/tasks/main.yml @@ -11,9 +11,11 @@ - "../templates/*" become: true -- name: Install dependencies from requirements.txt - ansible.builtin.pip: - requirements: /home/ec2-user/requirements.txt - umask: "0022" +- name: Ensure pip is installed + ansible.builtin.command: python3 -m ensurepip --upgrade become: true +- name: Install dependencies from requirements.txt + ansible.builtin.command: python3 -m pip install --user -r /home/ec2-user/requirements.txt + become: false + diff --git a/test/manual/definitions/apm/python/python-al2.json b/test/manual/definitions/apm/python/python-al2.json index df0fcf7e0..77942c022 100644 --- a/test/manual/definitions/apm/python/python-al2.json +++ b/test/manual/definitions/apm/python/python-al2.json @@ -11,7 +11,7 @@ "provider": "aws", "type": "ec2", "size": "t3.small", - "ami_name": "amzn2-ami-hvm-2.0.????????.?-x86_64-gp2", + "ami_name": "al2023-ami-2023.?.????????.?-kernel-?.?-x86_64", "user_name": "ec2-user" } ],