• English日本語한국어
  • Log inStart now

Configure the infrastructure agent using Ansible

You can use New Relic's Ansible role to install and configure our infrastructure monitoring agent. For instructions on how to use Ansible, see the Ansible documentation. This is a community-supported effort.

Want to configure the infrastructure agent using Ansible? Create a New Relic account for free! No credit card required.

Sample code

New Relic provides configuration management sample code to help you install our infrastructure monitoring agent using workflows and tools that are common with many Ops teams. This is a basic Ansible role and is intended to be used as a starting place for creating your own customized workflow.

Configuration depends on your specific setup and standards. To view an Ansible sample role and more integration information, see the Ansible Galaxy documentation.

Compatibility and requirements

The Ansible role with New Relic's infrastructure monitoring agent requires a supported Linux operating system.

Set up New Relic with Ansible

The newrelic.newrelic-infra role:

  • Adds the New Relic infrastructure agent package repository source.
  • Installs and configures the infrastructure agent.

To get started using this role:

  1. Include the role in your playbook.
  2. Customize the required variables.

All typical interactions with newrelic.newrelic-infra use role configuration. Here is an example of configuring your role to install the infrastructure agent:

- hosts: webservers
- role: newrelic.newrelic-infra
license_key: YOUR_LICENSE_KEY

Role configuration variables

Here are available variables for configuring the newrelic.newrelic-infra role:




Required. A map of key-value pairs. It corresponds directly with the available general configuration settings.

nrinfragent_state (Optional)

Describes what you want to do with the agent:

  • 'latest': Default. Installs the latest version of the infrastructure agent.
  • 'absent': Uninstall the agent.

nrinfragent_os_name (Optional)

Specifies the target OS that the infrastructure agent will be installed on. See the meta/main.yml file for the latest list.

nrinfragent_os_version (Optional)

Specifies the OS version of the installer package needed for this machine. See the meta/main.yml file for the latest list.

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.