From 33f19181c68cf7437cf48fa959d87d8648bad817 Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Mon, 25 Mar 2019 11:09:56 +0100 Subject: [PATCH 1/5] deprecate metapackage --- README.md | 2 -- defaults/main.yml | 4 +++- tasks/main.yml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 971aea9..8817ca7 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,6 @@ See the NewRelic documentation for current configuration options: ##### `nrinfragent_license_key` -##### `nrinfraintegrations_state` (OPTIONAL) - The state of the infrastructure integrations version pacakge. By default it's `absent`, which doesn't install the package; you can change it to `latest` or `present`. diff --git a/defaults/main.yml b/defaults/main.yml index 9cf972b..5e0c9a4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,9 @@ --- -nrinfraintegrations_state: "absent" nrinfragent_state: "latest" nrinfragent_service_enabled: "yes" nrinfragent_service_state: "started" nrinfragent_config: license_key: YOUR_LICENSE_KEY +nrinfragent_integrations: + - { name: nri-nginx, state: "absent" } + - { name: nri-mysql, state: "absent" } \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index ca66557..e6a973b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -88,8 +88,9 @@ - name: install integrations package: - name: "newrelic-infra-integrations" - state: "{{ nrinfraintegrations_state }}" + name: "{{ item.name }}" + state: "{{ item.state }}" + with_items: "{{ nrinfragent_integrations }}" - name: setup agent config template: From 7bb539c5d4f35c361118ef91890efefaacad3960 Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Mon, 25 Mar 2019 11:49:04 +0100 Subject: [PATCH 2/5] add integrations --- README.md | 17 ++++++++--------- defaults/main.yml | 6 +++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8817ca7..331d1e1 100644 --- a/README.md +++ b/README.md @@ -74,17 +74,16 @@ See the NewRelic documentation for current configuration options: ##### `nrinfragent_license_key` -The state of the infrastructure integrations version pacakge. By default it's +##### `nrinfragent_integrations` (OPTIONAL) + +List of the infrastructure integrations to be installed. Each package sould provide +`name` (e.g.: nri-nginx) and `state`. By default the state it's `absent`, which doesn't install the package; you can change it to `latest` or `present`. - -##### `nrinfragent_service_state` (OPTIONAL) -Specifies the state of the newrelic-infra service after installation. -Defaults to `started` which ensures the service will be running. You can change it to `stopped` to just install it but don't start it in this moment. - -##### `nrinfragent_service_enabled` (OPTIONAL) -Specifies if the service will be enabled (start during boot). -Defauts to `yes`, you can change it to `no` to prevent the service to automatically start on boot. +e.g. +nrinfragent_integrations: + - { name: nri-nginx, state: "latest" } + - { name: nri-mysql, state: "absent" } ###### DEPRECATED diff --git a/defaults/main.yml b/defaults/main.yml index 5e0c9a4..b576404 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,4 +6,8 @@ nrinfragent_config: license_key: YOUR_LICENSE_KEY nrinfragent_integrations: - { name: nri-nginx, state: "absent" } - - { name: nri-mysql, state: "absent" } \ No newline at end of file + - { name: nri-mysql, state: "absent" } + - { name: nri-cassandra, state: "absent" } + - { name: nri-apache, state: "absent" } + - { name: nri-redis, state: "absent" } + - { name: newrelic-infra-integrations, state: "absent" } \ No newline at end of file From 12b84468173a19b2dee45cbf1c87d3b54cf9b324 Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Mon, 25 Mar 2019 11:53:14 +0100 Subject: [PATCH 3/5] disable integrations by default --- defaults/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b576404..351fa2f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,10 +4,4 @@ nrinfragent_service_enabled: "yes" nrinfragent_service_state: "started" nrinfragent_config: license_key: YOUR_LICENSE_KEY -nrinfragent_integrations: - - { name: nri-nginx, state: "absent" } - - { name: nri-mysql, state: "absent" } - - { name: nri-cassandra, state: "absent" } - - { name: nri-apache, state: "absent" } - - { name: nri-redis, state: "absent" } - - { name: newrelic-infra-integrations, state: "absent" } \ No newline at end of file +nrinfragent_integrations: [] From f2ccfe8a7f4474d3ff4fe7575e929f6721f41d3e Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Tue, 26 Mar 2019 16:59:42 +0100 Subject: [PATCH 4/5] update doc --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 331d1e1..a161455 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ See the NewRelic documentation for current configuration options: ##### `nrinfragent_license_key` +##### `nrinfragent_service_state` (OPTIONAL) +Specifies the state of the newrelic-infra service after installation. +Defaults to `started` which ensures the service will be running. You can change it to `stopped` to just install it but don't start it in this moment. + +##### `nrinfragent_service_enabled` (OPTIONAL) +Specifies if the service will be enabled (start during boot). +Defauts to `yes`, you can change it to `no` to prevent the service to automatically start on boot. ##### `nrinfragent_integrations` (OPTIONAL) List of the infrastructure integrations to be installed. Each package sould provide From e4e910fee2ef36299fde71c1936e52d7c091357e Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Tue, 26 Mar 2019 17:26:57 +0100 Subject: [PATCH 5/5] update changelog and readme files --- CHANGELOG.md | 8 ++++++++ README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b21746..836ec10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ This file is used to list changes made in each version of the `nrinfragent` Ansible role. +## 0.7.0 + +IMPROVEMENTS: + +* Add support for installing individual integrations. The role switches from + the deprecated `newrelic-infra-integrations` package (which only + included 5 integrations), to the `nri-*` individual integration packages. + ## 0.6.1 (2019-01-09) BUG FIXES: diff --git a/README.md b/README.md index a161455..082e34c 100644 --- a/README.md +++ b/README.md @@ -81,16 +81,52 @@ Defaults to `started` which ensures the service will be running. You can change ##### `nrinfragent_service_enabled` (OPTIONAL) Specifies if the service will be enabled (start during boot). Defauts to `yes`, you can change it to `no` to prevent the service to automatically start on boot. + ##### `nrinfragent_integrations` (OPTIONAL) -List of the infrastructure integrations to be installed. Each package sould provide -`name` (e.g.: nri-nginx) and `state`. By default the state it's -`absent`, which doesn't install the package; you can change it to `latest` or -`present`. -e.g. +Specifies the infrastructure integrations to be installed. The list of available +integrations can be found [here][1]. + +Each package sould provide the `name` and `state`. The integrations package name is located +in the **Install and activate** section of the individual integrations docs. They use the +following convention: name of the service with the `nri-` prefix (`nri-apache`, `nri-redis`, ...). +By default the state it's `absent`, which doesn't install the package; you can change it to +`latest` or `present`. + +configuration e.g. + +``` nrinfragent_integrations: - { name: nri-nginx, state: "latest" } - { name: nri-mysql, state: "absent" } +``` + +The source code for each integration is available on [newrelic's github organization][2]. + +#### Removing newrelic-infra-integrations package and its bundled integrations + +**NOTE** *This only applies if you have the `newrelic-infra-integrations` +package installed* + +If you had installed the `newrelic-infra-integrations` package, +could be because you were using the previous versions of this module, or you +installed it some other way; and you want to do some cleanup by +removing it or any of the following integrations (the ones that came bundle +with it): + +- nri-redis +- nri-cassandra +- nri-apache +- nri-nginx +- nri-mysql + +You have to add `newrelic-infra-integrations` as the first item of the +`nrinfragent_integrations` with e desired state `absent`. + +``` +nrinfragent_integrations: + - { name: newrelic-infra-integrations, state: "absent" } +``` ###### DEPRECATED @@ -120,3 +156,6 @@ Specify the license key. For backward compatibility. Use `license_key` in * 12 Copyright (c) 2018 New Relic, Inc. All rights reserved. + +[1]: https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list +[2]: https://github.com/search?l=&p=1&q=nri-+user%3Anewrelic&ref=advsearch&type=Repositories&utf8=%E2%9C%93