Commit 65b8089d by Kevin Falcone Committed by GitHub

Merge pull request #3945 from edx/jibsheet/newrelic-infrastructure

Brief role for newrelic-infrastructure, enable for edxapp
parents 89e10f72 d2fcdefe
......@@ -26,5 +26,7 @@
when: COMMON_ENABLE_SPLUNKFORWARDER
- role: newrelic
when: COMMON_ENABLE_NEWRELIC
- role: newrelic
when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE
- role: minos
when: COMMON_ENABLE_MINOS
......@@ -92,6 +92,7 @@ COMMON_ENABLE_DATADOG: False
COMMON_ENABLE_NGINXTRA: False
COMMON_ENABLE_SPLUNKFORWARDER: False
COMMON_ENABLE_NEWRELIC: False
COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: False
# enables app reporting, you must enable newrelic
# as well
COMMON_ENABLE_NEWRELIC_APP: False
......
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role newrelic_infrastructure
#
#
# vars are namespace with the module name.
#
---
NEWRELIC_INFRASTRUCTURE_LICENSE_KEY: "SPECIFY_KEY_HERE"
NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO: 'deb https://download.newrelic.com/infrastructure_agent/linux/apt {{ ansible_distribution_release }} main'
NEWRELIC_INFRASTRUCTURE_DEBIAN_KEY_URL: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
# Any extra config you want to specify
# https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/infrastructure-config-file-template-newrelic-infrayml
NEWRELIC_INFRASTRUCTURE_EXTRA_CONFIG: ''
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
# newrelic_infrastructure
#
# Overview:
#
# Installs the New Relic Infrastructure service https://newrelic.com/infrastructure
##
# Dependencies:
#
# Example play:
# roles:
# - common
# - newrelic_infrastructure
#
#
- name: install license key
template:
src: etc/newrelic-infra.j2
dest: /etc/newrelic-infra.yml
mode: 0600
register: license_key_file
tags:
- install
- install:configuration
- name: Add apt key for New Relic Infrastructure
apt_key:
url: "{{ NEWRELIC_INFRASTRUCTURE_DEBIAN_KEY_URL }}"
state: present
tags:
- install
- install:app-requirements
- name: Install apt repository for New Relic Infrastructure
apt_repository:
repo: "{{ NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO }}"
state: present
update_cache: yes
tags:
- install
- install:app-requirements
- name: Install New Relic Infrastructure agent
apt:
name: "newrelic-infra"
tags:
- install
- install:code
- name: Restart the infrastructure agent if the license key changes
service:
name: newrelic-infra
state: restarted
when: license_key_file.changed
tags:
- install
- install:configuration
license_key: {{ NEWRELIC_INFRASTRUCTURE_LICENSE_KEY }}
{{ NEWRELIC_INFRASTRUCTURE_EXTRA_CONFIG }}
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