diff --git a/recipes/newrelic/apm/php/redhat.yml b/recipes/newrelic/apm/php/redhat.yml index fa3ae24ca..ee0f89b83 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. The RPM method is not supported on this version." 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: 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" } ],