Newrelic: merge roles

This commit is contained in:
Jérémy Lecour 2017-07-13 15:57:42 +02:00 committed by Jérémy Lecour
parent 9caf04e01f
commit 13b4fbb6bb
22 changed files with 47 additions and 161 deletions

View File

@ -1,14 +0,0 @@
# newrelic-php
Installation of NewRelic PHP agent.
## Tasks
Everything is in the `tasks/main.yml` file.
A license key and an application name can be provided to pre-configure the agent.
## Variables
* `newrelic_license`: license key (default: empty).
* `newrelic_appname`: application name (default: empty).

View File

@ -1,19 +0,0 @@
galaxy_info:
author: Evolix
description: Installation of NewRelic PHP agent.
issue_tracker_url: https://forge.evolix.org/projects/ansible-roles/issues
license: GPLv2
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- jessie
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -1,28 +0,0 @@
---
driver:
name: docker
privileged: true
use_sudo: false
provisioner:
name: ansible_playbook
hosts: test-kitchen
roles_path: ../
ansible_verbose: true
require_ansible_source: false
require_chef_for_busser: false
idempotency_test: true
platforms:
- name: debian
driver_config:
image: evolix/ansible:2.2.1
suites:
- name: default
provisioner:
name: ansible_playbook
playbook: ./tests/test.yml
transport:
max_ssh_sessions: 6

View File

@ -1,9 +0,0 @@
# newrelic-sources
Installation of NewRelic repository for APT sources.
## Tasks
Everything is in the `tasks/main.yml` file.
NB : the repository key is store in the role and not fetched online, for performance reasons.

View File

@ -1,19 +0,0 @@
galaxy_info:
author: Evolix
description: Installation of NewRelic repository for APT sources.
issue_tracker_url: https://forge.evolix.org/projects/ansible-roles/issues
license: GPLv2
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- jessie
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -1,4 +0,0 @@
---
- hosts: test-kitchen
roles:
- role: newrelic-sources

View File

@ -1,28 +0,0 @@
---
driver:
name: docker
privileged: true
use_sudo: false
provisioner:
name: ansible_playbook
hosts: test-kitchen
roles_path: ../
ansible_verbose: true
require_ansible_source: false
require_chef_for_busser: false
idempotency_test: true
platforms:
- name: debian
driver_config:
image: evolix/ansible:2.2.1
suites:
- name: default
provisioner:
name: ansible_playbook
playbook: ./tests/test.yml
transport:
max_ssh_sessions: 6

View File

@ -1,13 +0,0 @@
# newrelic-sysmond
Installation of NewRelic sysmond.
## Tasks
Everything is in the `tasks/main.yml` file.
if a license key is provided, the daemon is configured.
## Variables
* `newrelic_license`: license key (default: empty).

View File

@ -1,2 +0,0 @@
---
newrelic_license: ""

View File

@ -1,6 +0,0 @@
---
- name: restart newrelic-sysmond
systemd:
name: newrelic-sysmond
state: restarted

View File

@ -1,4 +0,0 @@
---
- hosts: test-kitchen
roles:
- role: newrelic-sysmond

17
newrelic/README.md Normal file
View File

@ -0,0 +1,17 @@
# newrelic-sources
Installation of NewRelic tools.
## Tasks
Everything is in the `tasks/main.yml` file.
NB : the repository key is store in the role and not fetched online, for performance reasons.
## Variables
* `newrelic_license`: license key (default: empty).
* `newrelic_appname`: application name (default: empty).
* `newrelic_php` : install the php module (default: `False`)
* `newrelic_sysmond` : install the sysmond agent (default: `True`)

View File

@ -1,3 +1,7 @@
---
newrelic_sysmond: True
newrelic_php: False
newrelic_license: ""
newrelic_appname: ""

View File

@ -13,3 +13,8 @@
- name: apt update
apt:
update_cache: yes
- name: restart newrelic-sysmond
systemd:
name: newrelic-sysmond
state: restarted

View File

@ -1,6 +1,6 @@
galaxy_info:
author: Evolix
description: Installation of NewRelic sysmond.
description: Installation of NewRelic tools.
issue_tracker_url: https://forge.evolix.org/projects/ansible-roles/issues

9
newrelic/tasks/main.yml Normal file
View File

@ -0,0 +1,9 @@
---
- include: sources.yml
- include: php.yml
when: newrelic_php
- include: sysmond.yml
when: newrelic_sysmond

View File

@ -1,6 +1,4 @@
---
- include_role:
name: newrelic-sources
- name: Pre-seed package configuration with app name
debconf:
@ -41,3 +39,4 @@
- name: Install package for PHP
apt:
name: newrelic-php5
state: installed

View File

@ -1,16 +1,10 @@
---
- name: Add dotdeb GPG key
apt_key:
# url: https://download.newrelic.com/548C16BF.gpg
data: "{{ lookup('file', '548C16BF.gpg') }}"
- name: Find squid config whitelist
shell: find /etc/squid/whitelist-custom.conf /etc/squid3/whitelist-custom.conf /etc/squid/whitelist.conf /etc/squid3/whitelist.conf 2> /dev/null
failed_when: false
changed_when: false
check_mode: no
register: squid_whitelist_files
- name: set squid_service_name=squid3 for Debian < 9
set_fact:
squid_service_name: squid3
@ -18,6 +12,13 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('9', '<')
- name: Find squid config whitelist
shell: find /etc/{{ squid_service_name | default('squid') }}/whitelist-custom.conf /etc/{{ squid_service_name | default('squid') }}/whitelist.conf 2> /dev/null
failed_when: false
changed_when: false
check_mode: no
register: squid_whitelist_files
- name: Append packages.dotdeb.org to Squid whitelist
lineinfile:
dest: "{{ squid_whitelist_files.stdout_lines | first }}"
@ -33,5 +34,4 @@
repo: "deb http://apt.newrelic.com/debian/ newrelic non-free"
state: present
filename: newrelic
- meta: flush_handlers
update_cache: yes

View File

@ -1,6 +1,4 @@
---
- include_role:
name: newrelic-sources
- name: Install system monitor daemon
apt:

View File

@ -1,4 +1,4 @@
---
- hosts: test-kitchen
roles:
- role: newrelic-php
- role: newrelic