newrelic / ansible-install

Building installation support for our customers are using ansible to manage their infrastructure and services at scale
Apache License 2.0
8 stars 6 forks source link

New Relic Open Source community project banner.

New Relic Ansible Role

newrelic.newrelic_install is an Ansible Role that will help you scale your New Relic Observability efforts. It uses the New Relic CLI and New Relic Open Installation repository to achieve this.

Note: Installing specific versions of an agent is not supported, this role will always install latest released version of a New Relic agent.

Please, check out the sections below for details on installation, how to get started, role's variables, dependencies and an example ansible playbook showcasing this role's usage.

If you need help with Ansible for Windows OS, take a look at Setting up a Windows Host, from the Ansible Documentation site.

Installation

Ansible Galaxy

ansible-galaxy install newrelic.newrelic_install

Link to Galaxy

Make sure you have ansible.windows and ansible.utils if they are not already installed:

ansible-galaxy collection install ansible.windows ansible.utils

Manual

If you want to use a local copy of the role, clone the repo and run make in the project root to copy this repo to ~/.ansible/roles/newrelic.newrelic_install, enabling the role to behave as though it were installed from Galaxy.

Getting Started

After installing, include the newrelic.newrelic_install role in a new or existing playbook. For example:

- name: Install New Relic
  hosts: all
  roles:
    - role: newrelic.newrelic_install
      vars:
        targets:
          - infrastructure
          - logs
          - apm-php
        tags:
          foo: bar
  environment:
    NEW_RELIC_API_KEY: <API key>
    NEW_RELIC_ACCOUNT_ID: <Account ID>
    NEW_RELIC_REGION: <Region>

Variables

Role variables

targets (Required)

List of targeted installs to run on hosts. Available options are:

Important Notes:

tags (Optional)

Key-value pairs of tags passed to the installation.

install_timeout_seconds (Optional)

Sets timeout for installation task. Overrides the default timeout of 600s.

verbosity (Optional)

Verbosity options for the installation (debug or trace). Writes verbose output to a log file on the host.

Defaults

Set in defaults/main.yml:

Environment variables

Values are set under the environment keyword in your playbook:

Additionally, an optional HTTPS_PROXY variable can be set to enable a proxy for your installation.

apm-php:

apache:

mssql:

mysql:

See ansible's remote environment for more info.

Versions Compatibility

Dependencies

Python requirements: requirements.txt

Ansible requirements: requirements.yml

Example Playbook

- name: Install New Relic
  hosts: all
  roles:
    - role: newrelic.newrelic_install
      vars:
        targets:
          - infrastructure
          - logs
          - apm-php
        tags:
          foo: bar
        install_timeout_seconds: 1000
        verbosity: debug
  environment:
    NEW_RELIC_API_KEY: <API key>
    NEW_RELIC_ACCOUNT_ID: <Account ID>
    NEW_RELIC_REGION: <Region>
    NEW_RELIC_APPLICATION_NAME: "My Application"
    HTTPS_PROXY: "http://my.proxy:8888"

Support

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

Contribute

We encourage your contributions to improve the newrelic.newrelic_install ansible role! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at opensource@newrelic.com.

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today.

License

This project is licensed under the Apache 2.0 License.