Commit fd101d08 by arbabnazar

YAML style parameters passing

parent dc1c4159
......@@ -21,6 +21,8 @@ NEWRELIC_DEBIAN_KEY_ID: '548C16BF'
NEWRELIC_DEBIAN_KEY_URL: 'https://download.newrelic.com/{{ NEWRELIC_DEBIAN_KEY_ID }}.gpg'
NEWRELIC_LICENSE_KEY: "SPECIFY_KEY_HERE"
NEWRELIC_AMAZON_REPO: 'https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm'
#
# OS packages
#
......@@ -30,3 +32,4 @@ newrelic_debian_pkgs:
newrelic_redhat_pkgs:
- newrelic-sysmond
---
- name: restart newrelic-logwatch-agent
service: name=newrelic-logwatch-agent state=restarted
......@@ -25,37 +25,43 @@
# roles:
# - newrelic
- name: add apt key
apt_key: >
id="{{ NEWRELIC_DEBIAN_KEY_ID }}" url="{{ NEWRELIC_DEBIAN_KEY_URL }}"
state=present
- name: Add apt key for New Relic
apt_key:
id: "{{ NEWRELIC_DEBIAN_KEY_ID }}"
url: "{{ NEWRELIC_DEBIAN_KEY_URL }}"
state: present
when: ansible_distribution == 'Ubuntu'
- name: Configure the New Relic Servers yum repository
shell: >
rpm -Uvh https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
creates=/etc/yum.repos.d/newrelic.repo
when: ansible_distribution == 'Amazon'
- name: install apt repository
apt_repository: repo="{{ NEWRELIC_DEBIAN_REPO }}" update_cache=yes
when: ansible_distribution == 'Ubuntu'
- name: install newrelic agent (apt)
apt: pkg="newrelic-sysmond"
- name: Install apt repository for New Relic
apt_repository:
repo: "{{ NEWRELIC_DEBIAN_REPO }}"
state: present
update_cache: yes
when: ansible_distribution == 'Ubuntu'
- name: Install newrelic related system packages for Ubuntu
apt: pkg={{ item }} install_recommends=yes state=present
with_items: newrelic_debian_pkgs
apt:
name: "{{ item }}"
install_recommends: yes
state: present
with_items: "{{ newrelic_debian_pkgs }}"
when: ansible_distribution == 'Ubuntu'
- name: Configure the New Relic Servers yum repository
yum:
name: "{{ NEWRELIC_AMAZON_REPO }}"
state: present
when: ansible_distribution == 'Amazon'
- name: Install newrelic related system packages for Amazon
yum: pkg={{ item }} state=present
with_items: newrelic_redhat_pkgs
yum:
name: "{{ item }}"
state: present
update_cache: yes
with_items: "{{ newrelic_redhat_pkgs }}"
when: ansible_distribution == 'Amazon'
- name: configure the agent
- name: Configure the agent
template:
src: "etc/newrelic/nrsysmond.cfg.j2"
dest: "/etc/newrelic/nrsysmond.cfg"
......@@ -63,5 +69,8 @@
group: "newrelic"
mode: 0640
- name: ensure started and enabled
service: name=newrelic-sysmond state=restarted enabled=yes
- name: Ensure started and enabled
service:
name: newrelic-sysmond
state: restarted
enabled: yes
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