Commit 918b3f15 by Feanil Patel

Merge pull request #2432 from edx/feanil/newrelic_playbook

A playbook to tag instances by EDC.
parents 4374dfb8 aaadd9ad
# Run newrelic against a set of machines by tag.
# ansible-playbook -i ec2.py --limit "tag_cluster_mongo" newrelic.yml -e NEWRELIC_LICENSE_KEY='SET_ME' -v
- name: Deploy Newrelic Server Monitoring
hosts: all
sudo: True
gather_facts: True
vars:
CLUSTER_NAME: 'edxapp'
ec2_region: 'us-east-1'
pre_tasks:
- name: Get instance info
action: ec2_facts
- name: Get instance tags
ec2_tag:
resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ec2_region }}"
state: "list"
register: instance_tags
- name: Set labels from EDC
set_fact:
COMMON_ENVIRONMENT: "{{ instance_tags.tags.environment }}"
COMMON_DEPLOYMENT: "{{ instance_tags.tags.deployment }}"
CLUSTER_NAME: "{{ instance_tags.tags.cluster }}"
roles:
- role: newrelic
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