Working on your puppet master server(s), follow all of the instructions below:

Step 1: Install Plugins

Currently, puppet masters need additional Ruby plugins in order to use PuppetDB. Unlike custom facts or functions, these cannot be loaded from a module and must be installed in Puppet’s main source directory.

Run sudo cp -R ext/master/lib/puppet /usr/lib/ruby/site_ruby/1.8/puppet. Replace the second path with the path to your Puppet installation if you have installed it somewhere other than /usr/lib/ruby/site_ruby.

Step 2: Edit Config Files

Locate Puppet’s Config Directory

Find your puppet master’s config directory by running sudo puppet config print confdir. It will usually be at either /etc/puppet/ or /etc/puppetlabs/puppet/.

You will need to edit (or create) three files in this directory:

1. Edit puppetdb.conf

The puppetdb.conf file will probably not exist yet. Create it, and add the PuppetDB server’s hostname and port:

[main]
server = puppetdb.example.com
port = 8081

PuppetDB’s port for secure traffic defaults to 8081.

Puppet requires use of PuppetDB’s secure HTTPS port. You cannot use the unencrypted, plain HTTP port.

If no puppetdb.conf file exists, the following default values will be used:

server = puppetdb
port = 8081

2. Edit puppet.conf

To enable PuppetDB for the inventory service and saved catalogs/exported resources, add the following settings to the [master] block of puppet.conf (or edit them if already present):

[master]
storeconfigs = true
storeconfigs_backend = puppetdb

Note: The thin_storeconfigs and async_storeconfigs settings should be absent or set to false. If you have previously used the puppet queue daemon (puppetqd), you should now disable it.

Enabling experimental report storage

Version 1.1 of PuppetDB includes experimental support for storing Puppet
reports. This feature can be enabled by simply adding the puppetdb report
processor in your puppet.conf file. If you don’t already have a reports
setting in your puppet.conf file, you’ll probably want to add a line like this:

reports = store,puppetdb

This will keep Puppet’s default behavior of storing the reports to disk as YAML,
while also sending the reports to PuppetDB.

You can configure how long PuppetDB stores these reports, and you can do some
very basic querying. For more information, see:

More information about Puppet report processors in general can be found
here.

3. Edit routes.yaml

The routes.yaml file will probably not exist yet. The path to this Puppet configuration file can be found with the command puppet master --configprint route_file.

Create it if necessary, and add the following:

---
master:
facts:
terminus: puppetdb
cache: yaml

This will make PuppetDB the authoritative source for the inventory service.

Step 3: Restart Puppet Master

Use your system’s service tools to restart the puppet master service. For open source users, the command to do this will vary depending on the front-end web server being used.

Your puppet master should now be using PuppetDB to store and retrieve catalogs, facts, and exported resources. You can test this by triggering a puppet agent run on an arbitrary node, then logging into your PuppetDB server and viewing the /var/log/puppetdb/puppetdb.log file — you should see calls to the “replace facts” and “replace catalog” commands: