-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NR-164383 feat: role for newrelic-cli
- Loading branch information
1 parent
d01b069
commit 340b132
Showing
3 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Install agents using New Relic CLI | ||
|
||
```yaml | ||
- name: install agent via newrelic-cli | ||
include_role: | ||
name: caos.ansible_roles.newrelic_cli | ||
vars: | ||
repo_endpoint: "https://download.newrelic.com/" | ||
recipe: "newrelic-infra" | ||
region: "STAGING" # US | EU | STAGING | ||
nr_api_key: "user-api-key" | ||
nr_account_id: "nr-account-id" | ||
|
||
``` |
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,20 @@ | ||
--- | ||
|
||
# Currently package from production is installed because stg does not have https and nr-cli verifies this | ||
# Until this is fixed we need to clean metadata to avoid error: "Not using downloaded repomd.xml because it is older than what we have" | ||
- name: clean metadata | ||
command: yum clean metadata | ||
when: ansible_pkg_mgr == 'yum' | ||
|
||
- name: Download newrelic-cli installer | ||
get_url: | ||
url: https://raw.githubusercontent.com/newrelic/newrelic-cli/master/scripts/install.sh | ||
dest: /tmp/newrelic-cli-install.sh | ||
mode: '0111' | ||
|
||
- name: Install newrelic-cli | ||
shell: yes | /tmp/newrelic-cli-install.sh | ||
|
||
- name: Install agent via newrelic-cli | ||
no_log: true | ||
shell: NEW_RELIC_DOWNLOAD_URL="{{ repo_endpoint }}" NEW_RELIC_REGION="{{ region }}" NEW_RELIC_API_KEY={{ nr_api_key }} NEW_RELIC_ACCOUNT_ID={{ nr_account_id }} /usr/local/bin/newrelic install -n {{ recipe }} --debug -y |
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,5 @@ | ||
repo_endpoint: "https://nr-downloads-ohai-staging.s3.amazonaws.com/" | ||
recipe: "newrelic-infra" | ||
region: "STAGING" | ||
nr_api_key: "" | ||
nr_account_id: "" |