Commit 2f3331b4 by e0d

refactoring.

parent eaebc113
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
# #
newrelic_role_name: newrelic newrelic_role_name: newrelic
COMMON_NEWRELIC_REPO: 'deb http://apt.newrelic.com/debian/ newrelic non-free' NEWRELIC_REPO: 'deb http://apt.newrelic.com/debian/ newrelic non-free'
COMMON_NEWRELIC_KEY_ID: '548C16BF' NEWRELIC_KEY_ID: '548C16BF'
COMMON_NEWRELIC_KEY_URL: 'https://download.newrelic.com/548C16BF.gpg' NEWRELIC_KEY_URL: 'https://download.newrelic.com/{{ NEWRELIC_KEY_ID }}.gpg'
COMMON_NEWRELIC_LICENSE_KEY: 'bad547c0367f61fc2fbcce830399d7bdfde82d74' NEWRELIC_LICENSE_KEY: 'NEW-RELIC-KEY'
NEWRELIC_APP_NAME: 'e0d-sandbox' NEWRELIC_APP_NAME: 'e0d-sandbox'
...@@ -28,6 +28,7 @@ NEWRELIC_APP_NAME: 'e0d-sandbox' ...@@ -28,6 +28,7 @@ NEWRELIC_APP_NAME: 'e0d-sandbox'
# OS packages # OS packages
# #
newrelic_debian_pkgs: [] newrelic_debian_pkgs:
- newrelic-sysmond
newrelic_redhat_pkgs: [] newrelic_redhat_pkgs: []
...@@ -26,18 +26,24 @@ ...@@ -26,18 +26,24 @@
# - newrelic # - newrelic
- name: add apt key - name: add apt key
apt_key: id=548C16BF url={{COMMON_NEWRELIC_KEY_URL }} state=present apt_key: >
id="{{ NEWRELIC_KEY_ID }}" url="{{ NEWRELIC_KEY_URL }}"
state=present
- name: install apt repository - name: install apt repository
apt_repository: repo="{{ COMMON_NEWRELIC_REPO }}" update_cache=yes apt_repository: repo="{{ NEWRELIC_REPO }}" update_cache=yes
- name: install newrelic agent - name: install newrelic agent
apt: pkg="newrelic-sysmond" apt: pkg="newrelic-sysmond"
- name: Install newrelic related system packages.
apt: pkg={{ item }} install_recommends=yes state=present
with_items: newrelic_debian_pkgs
- name: configure the agent with the license key - name: configure the agent with the license key
shell: > shell: >
nrsysmond-config --set license_key={{ COMMON_NEWRELIC_LICENSE_KEY }} nrsysmond-config --set license_key="{{ NEWRELIC_LICENSE_KEY }}"
ssl=true ssl=true
- name: start the newrelic system agent - name: ensure started and enabled
shell: /etc/init.d/newrelic-sysmond start service: name=newrelic-sysmond state=started enabled=yes
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment