The Puppet Forge

Length: 00:10:33

Lesson Summary:

We don't need to create new modules for every thing we need to do with Puppet, however. The Puppet Forge is a repository of existing Puppet modules written by PuppetLabs and other contributors. We could even add a module, although not all modules are Puppet-approved, and there are various ways to weed out modules that might not be the most useful in most use cases.

The Puppet Forge is located at forge.puppet.com. Head over and search for puppetdb. PuppetDB is our next lesson, but to prepare for that we're going to install it through the use of the PuppetLabs' PuppetDB module on the Forge.

Once on the search page, take a look at the sidebar Guide to module badges. This is how we can tell the quality of a module. There are five badges. Three are quality badges:

  • Supported means it works on Puppet Enterprise and is maintained by Puppet.
  • Partner means it works on Puppet Enterprise and is maintained by a Puppet partner.
  • Approved means that Puppet has reviewed the module and found it meets their standards, but it is not maintained by Puppet or a supported partner.

And two are support badges:

  • Tasks means the module works with Tasks, which is part of Puppet Bolt; it's an automation tool.
  • PDK means the module works with Puppet Development Kit validation and testing.

Let's ago head and click on the PuppetDB module. Here we have download instructions and information on using the module. Any specific directions for using the module would be here, such as Hiera data we need to add, or changes to any manifests to achieve specific behavior. Luckily for us, we don't have to do anything special to add the PuppetDB module.

On the PuppetDB page, we're presented with two installation options. The Puppetfile method is related to Puppet Enterprise. Since we're using Puppet Open Source to get started, we'll be downloading the module with the puppet module command.

Let's switch back to the command line and drop to root with sudo -i, if you are not there already.

The puppet module command allows us to search for, install, uninstall, upgrade, and list modules. In previous versions of Puppet, it was also the command used to generate the skeleton of a new module, but that behavior has been deprecated in favor of the Puppet Dev Kit.

Let's go ahead and install PuppetDB.

# puppet module install puppetlabs-puppetdb

Now, move into the modules directory for the production environment and list the contents of the directory:

# ls
apt       inifile     puppetdb
concat    nginx        stdlib
firewall  postgresql  translate

Not just the PuppetDB module installed! That's because when we installed a module from the Puppet Forge, all its dependent modules are installed along with it.

Since we don't need to make changes to the module itself for it work, all we have to do to install PuppetDB on its desired server is to add it to our site.pp file. Return to the production directory and open the site mapping:

# $EDITOR manifests/site.pp

Generally, PuppetDB would be hosted on its own server, with the option to put the Postgresql database on a third, separate server. However, for test and smaller environments, like ours, we can install it alongside our Puppet Server:

node PUPPETSERVER.mylabserver.com {
  # Configure puppetdb and its underlying database
  class { 'puppetdb': }
  # Configure the Puppet master to use puppetdb
  class { 'puppetdb::master::config': }
}

Note that this was taken straight from the PuppetDB instructions on the Puppet Forge. There's no extra work beyond updating the node name!

We can now force a Puppet run with:

# puppet agent -t

Note that you may need to run this command twice; occasionally, the PostgreSQL database takes too long to respond and the PuppetDB install will not complete. Running the command a second time should solve any of these issues.

Check that PuppetDB is up and running:

# systemctl status puppetdb

Using PuppetDB

Now, an in-depth look of PuppetDB is out of line with the goals of a quick start, but that doesn't mean we can't give you a place to start. Currently, we can see that PuppetDB is gathering information about our agent node by running:

# puppet node status AGENTNODE.mylabserver.com

We can take this a step further by providing additional information to PuppetDB by adding exported resources to our modules. Exported resources let us take PuppetDB information and send it to tools such as Nagios.

Additionally, should we make the jump to Puppet Enterprise, PuppetDB has a robust client tool available for use that makes it easier to export and anonymize our PuppetDB data.


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More