Skip to content

Commit

Permalink
super_agent: fix repo installation in Amazon Linux (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenruizdegauna authored Mar 18, 2024
1 parent 696b74d commit ab03c52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/newrelic/infrastructure/super-agent/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,16 @@ install:
- |
if [ "{{.AMAZON_LINUX_VERSION}}" != "2" ] && [ "{{.AMAZON_LINUX_VERSION}}" != "2023" ] ; then
SUPER_AGENT_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
INFRA_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
else
SUPER_AGENT_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
INFRA_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
fi
IS_NEWRELIC_AVAILABLE=$(curl -Ls $SUPER_AGENT_REPO_URL | grep "\[newrelic-infra\]" | wc -l)
if [ $IS_NEWRELIC_AVAILABLE -eq 0 ] ; then
echo "newrelic super agent is not available for this architecture {{.ARCH}}. See our documentation for installing manually https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/install-new-relic" >&2
exit 131
fi
INFRA_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/el/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
curl -s $INFRA_REPO_URL -o /etc/yum.repos.d/newrelic-infra.repo
curl -s $SUPER_AGENT_REPO_URL | sed 's/\[newrelic-infra]/\n[newrelic-super-agent]/g' >> /etc/yum.repos.d/newrelic-infra.repo
Expand Down

0 comments on commit ab03c52

Please sign in to comment.