-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #900 from mkllnk/new-relic
Install New Relic infrastructure agent
- Loading branch information
Showing
4 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: restart newrelic_infra | ||
service: | ||
name: "newrelic-infra.service" | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
|
||
- name: Download installer | ||
ansible.builtin.get_url: | ||
url: "https://download.newrelic.com/install/newrelic-cli/scripts/install.sh" | ||
dest: "/tmp/new-relic-install.sh" | ||
mode: "777" | ||
|
||
- name: Install New Relic command | ||
ansible.builtin.command: "/tmp/new-relic-install.sh" | ||
args: | ||
creates: /usr/local/bin/newrelic | ||
|
||
- name: Install New Relic agent | ||
command: /usr/local/bin/newrelic install -y | ||
environment: | ||
NEW_RELIC_API_KEY: "{{ new_relic_api_key }}" | ||
NEW_RELIC_ACCOUNT_ID: "{{ new_relic_account_id }}" | ||
NEW_RELIC_REGION: "{{ new_relic_region }}" | ||
args: | ||
creates: /usr/bin/newrelic-infra | ||
|
||
- name: Use our standard names in dashboard | ||
lineinfile: | ||
name: "/etc/newrelic-infra.yml" | ||
line: "display_name: {{ host_id }}" | ||
regex: "^display_name:" | ||
state: present | ||
notify: restart newrelic_infra |