Skip to content

Commit 457ae81

Browse files
committed
1 parent 4387383 commit 457ae81

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cloud66/newrelic-infra

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# {{Description: This deploy hook will run the following code snippet to automate the installation of NewRelic, and requires the NEWRELIC_KEY environment variable to be set on a stack.}}
2+
if [ -z "$NEWRELIC_KEY" ]
3+
then
4+
>&2 echo "Please set your NEWRELIC_KEY environment variable"
5+
exit 1
6+
else
7+
if [ -s /etc/apt/sources.list.d/newrelic-infra.list ]
8+
then
9+
sudo rm -f /etc/apt/sources.list.d/newrelic-infra.list
10+
printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt trusty main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
11+
else
12+
printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt trusty main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
13+
fi
14+
15+
printf "license_key: %s\n" "$NEWRELIC_KEY" | sudo tee -a /etc/newrelic-infra.yml
16+
17+
sudo wget -O- https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo apt-key add -
18+
sudo apt-get update -y
19+
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install newrelic-infra
20+
sudo initctl start newrelic-infra
21+
fi

0 commit comments

Comments
 (0)