Plugin installation with Chef and Puppet

Chef and Puppet are configuration management tools that simplify software management and server provisioning. They provide reusable configuration scripts, called cookbooks within Chef and modules within Puppet, to automate plugin installation and management.

Chef cookbooks and Puppet modules make it easier to install New Relic plugins with required runtime dependencies, such as Java or Ruby. Managing plugins with user permissions and startup scripts also is easier.

Plugins is not supported with accounts that host data in the EU region data center.

Install plugins with Chef

Plugins in Plugin Central may come bundled with a Chef script, or you can write your own. If a Chef script is provided, this does not mean you are required to use it to install the plugin.

To use Chef, it must be installed on your system. Several versions of Chef are available, including an open source and an Enterprise version. For more information on versions and installation, see the Chef overview.

Before installing a plugin using Chef, add the Chef cookbook for New Relic Plugins:

Then, to install a plugin using Chef:

  1. Configure Chef with the plugin details. See the Chef installation example.
  2. Run Chef to install the plugin. See Chef's documentation for detailed instructions.

Chef example

Chef cookbooks and recipes define roles for specific server configurations. For example, a web server might have the role 'web_server' which includes all of the software and configuration needed for a web server.

Here is an example of creating a Chef role for a server running the Wikipedia Java example plugin:

name "newrelic_wikipedia_example_java_plugin"
description "Server running the New Relic Plugins Wikipedia Example Java Plugin"
run_list(
  "recipe[newrelic_plugins::wikipedia_example_java]"
)
default_attributes(
  "newrelic" => {
    "license_key"            => "NEW_RELIC_LICENSE_KEY",
    "wikipedia_example_java" => {
      "install_path"         => "/path/to/plugin",
      "user"                 => "newrelic"
    }
  }
)

For more information about using Chef with New Relic plugins, see the Chef Community site.

Installing plugins with Puppet

Plugins in Plugin Central may come bundled with a Puppet script, or you can write your own. If a Puppet script is provided, this does not mean you are required to use it to install the plugin.

To use Puppet, it must be installed on your system. Several versions of Puppet are available, including an open source and an Enterprise version. For more information on versions and installation, see Puppet overview.

Before installing a plugin using Puppet, add New Relic's Puppet module for plugins:

Then, to install a plugin using Puppet:

  1. Configure Puppet with the plugin details. See the Puppet installation example.
  2. Run Puppet to install the plugin. See Puppet's documentation for detailed instructions.

Puppet example

Puppet modules contain manifest files that are a collection of classes for configuring a server. For example, a web server can be assigned several classes for the necessary software for a web server.

Here is an example of using a Puppet class for a server running the Wikipedia Java example plugin:


class { 'newrelic_plugins::wikipedia_example_java':
  license_key   => 'NEW_RELIC_LICENSE_KEY',
  install_path  => '/path/to/plugin',
  user          => 'newrelic'
}

For more information on using Puppet with New Relic plugins, see the Puppet Forge site.

Plugin dependencies

At a minimum, a Java or Ruby runtime is required for New Relic plugins. Additional dependencies are listed in the installation instructions for the specific plugin.

Java or Ruby runtime dependencies can be installed and managed with Chef and Puppet.

Chef and Puppet community sites

Chef and Puppet both provide active community sites for learning Chef and Puppet as well as for listing and finding community-contributed cookbooks and modules.

For more help

Additional documentation resources include:

Recommendations for learning more: