Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: add newrelic repo
- action: template src=templates/aptrepo_newrelic.j2 dest=/etc/apt/sources.list.d/newrelic.conf
- only_if: is_set('${newrelic_key}')
- - name: install nrsysmond
- action: apt pkg=newrelic-sysmond state=latest
- only_if: is_set('${newrelic_key}')
- - name: get nrsysmond.cfg content
- action: command sed -nr 's/^license_key=([[:alnum:]]+)/\\1/p' /etc/newrelic/nrsysmond.cfg
- register: current_newrelic_key
- ignore_errors: True
- only_if: "is_set('${newrelic_key}')"
- - name: debug
- local_action: debug msg="current key = ${current_newrelic_key.stdout}"
- - name: configure nrsysmond
- action: shell /usr/sbin/nrsysmond-config --set license_key=${newrelic_key}
- only_if: "is_set('${newrelic_key}') and '${current_newrelic_key.stdout}' != '${newrelic_key}'"
- notify:
- - restart_nrsysmond
- - name: start nrsysmond
- action: service name=newrelic-sysmond state=started
- only_if: is_set('${newrelic_key}')
- ignore_errors: True
Advertisement
Add Comment
Please, Sign In to add comment