Commit 31159f15 by Fred Smith

Merge pull request #2083 from edx/derf/newrelic-npi-role

newrelic npi role
parents 6f136045 fa6fc209
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role newrelic-npi
#
#
# vars are namespace with the module name.
#
newrelic-npi_role_name: newrelic-npi
#
# OS packages
newrelic-npi_debian_pkgs: []
newrelic-npi_redhat_pkgs: []
NEWRELIC_USER: 'newrelic'
# NPI
NEWRELIC_NPI_PREFIX: "/edx/app/npi/"
NEWRELIC_NPI_VERSION: "0.1.5"
NEWRELIC_NPI_PLATFORM: "linux"
NEWRELIC_NPI_ARCH: "x64"
NEWRELIC_NPI_DISTRO: "debian"
NEWRELCI_NPI_PLUGINS: []
newrelic_npi_installer: "platform_installer-{{ NEWRELIC_NPI_PLATFORM }}-{{ NEWRELIC_NPI_ARCH }}-v{{ NEWRELIC_NPI_VERSION }}.tar.gz"
NEWRELIC_NPI_URL: "https://download.newrelic.com/npi/v{{ NEWRELIC_NPI_VERSION }}/{{ newrelic_npi_installer }}"
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role newrelic-npi
#
# Example:
#
dependencies:
- role: newrelic
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role newrelic-npi
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
- name: Download newrelic NPI
get_url: >
dest="/tmp/{{ newrelic_npi_installer }}"
url="{{ NEWRELIC_NPI_URL }}"
register: download_npi_installer
- name: create npi install directory {{ NEWRELIC_NPI_PREFIX }}
file: >
path="{{ NEWRELIC_NPI_PREFIX }}"
state=directory
mode=0755
owner="{{ NEWRELIC_USER }}"
- name: install newrelic npi
shell: >
tar -xzf /tmp/{{ newrelic_npi_installer }} --strip-components=1 -C "{{NEWRELIC_NPI_PREFIX}}"
when: download_npi_installer.changed
sudo_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the default user
shell: >
{{ NEWRELIC_NPI_PREFIX }}/bin/node {{ NEWRELIC_NPI_PREFIX }}/npi.js "set user {{ NEWRELIC_USER }}"
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the license key
shell: >
./npi set license_key {{ NEWRELIC_LICENSE_KEY }}
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the distro
shell: >
./npi set distro {{ NEWRELIC_NPI_DISTRO }}
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}"
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