Commit feec79ae by Fred Smith

elasticsearch monitor role

parent 31159f15
---
#
# 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 elasticsearch-monitor
#
#
# vars are namespaced with the module name.
#
newrelic-npi-elasticsearch_role_name: newrelic-npi-elasticsearch
ELASTICSEARCH_MONITOR_PLUGIN: "me.snov.newrelic-elasticsearch"
ELASTICSEARCH_MONITOR_HOSTS:
- name: "elasticsearch"
host: "localhost"
port: "9200"
elasticsearch_monitor_plugin_config:
agents:
"{{ ELASTICSEARCH_MONITOR_HOSTS }}"
#
# OS packages
#
newrelic-npi-elasticsearch_debian_pkgs: []
newrelic-npi-elasticsearch_redhat_pkgs: []
---
#
# 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 elasticsearch-monitor
#
# Example:
#
dependencies:
- role: newrelic-npi
---
#
# 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 elasticsearch-monitor
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
- name: download elasticsearch plugin
shell: >
./npi fetch {{ ELASTICSEARCH_MONITOR_PLUGIN }} -y
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
creates: "{{ NEWRELIC_NPI_PREFIX }}/plugins/{{ ELASTICSEARCH_MONITOR_PLUGIN }}.compressed"
sudo_user: "{{ NEWRELIC_USER }}"
- name: prepare elasticsearch plugin
shell: >
./npi prepare {{ ELASTICSEARCH_MONITOR_PLUGIN }} -n
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}"
- name: configure elasticsearch plugin
template: >
src=plugins/me.snov.newrelic-elasticsearch/newrelic-elasticsearch-plugin-1.4.1/config/plugin.json.j2
dest={{ NEWRELIC_NPI_PREFIX }}/plugins/{{ ELASTICSEARCH_MONITOR_PLUGIN }}/newrelic-elasticsearch-plugin-1.4.1/config/plugin.json
owner={{ NEWRELIC_USER }}
mode=0644
- name: register/start elasticsearch plugin
shell: >
./npi add-service {{ ELASTICSEARCH_MONITOR_PLUGIN }} --start --user={{ NEWRELIC_USER }}
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "root"
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