---
# This playbook configures newrelic monitoring service

- name: add newrelic repo key
  apt_key:
    url: https://download.newrelic.com/548C16BF.gpg
    id: 548C16BF
    state: present
  become: yes

- name: add newrelic repo
  apt_repository:
    repo: 'deb http://apt.newrelic.com/debian/ newrelic non-free'
    state: present
  become: yes

- name: install newrelic
  apt: pkg=newrelic-sysmond state=present update_cache=yes cache_valid_time=3600
  become: yes

- name: set license key
  shell: nrsysmond-config --set license_key={{newrelic_license_key}}
  become: yes

- name: stop newrelic if already running
  shell: /etc/init.d/newrelic-sysmond stop
  become: yes
  ignore_errors: yes

- name: start newrelic
  shell: /etc/init.d/newrelic-sysmond start
  become: yes

---
# This playbook configures newrelic monitoring service

- name: add newrelic repo key
  apt_key:
    url: https://download.newrelic.com/548C16BF.gpg
    id: 548C16BF
    state: present
  become: yes

- name: add newrelic repo
  apt_repository:
    repo: 'deb http://apt.newrelic.com/debian/ newrelic non-free'
    state: present
  become: yes

- name: install newrelic
  apt: pkg=newrelic-sysmond state=present update_cache=yes cache_valid_time=3600
  become: yes

- name: set newrelic license key
  shell: nrsysmond-config --set license_key={{newrelic_license_key}}
  become: yes

- name: stop newrelic daemon if already running
  shell: /etc/init.d/newrelic-sysmond stop
  become: yes
  ignore_errors: yes

- name: start newrelic daemon
  shell: /etc/init.d/newrelic-sysmond start
  become: yes

Add clarification on newrelic role
Add clarification on newrelic role
