The number of command processing threads to use. Defaults to `undef`, using the
PuppetDB built-in default.
#### `concurrent_writes`
The number of threads allowed to write to disk at any one time. Defaults to
`undef`, which uses the PuppetDB built-in default.
#### `store_usage`
The amount of disk space (in MB) to allow for persistent message storage.
Defaults to `undef`, using the PuppetDB built-in default.
#### `temp_usage`
The amount of disk space (in MB) to allow for temporary message storage.
Defaults to `undef`, using the PuppetDB built-in default.
#### `disable_update_checking`
Setting this to true disables checking for updated versions of PuppetDB and sending basic analytics data to Puppet.
Defaults to `undef`, using the PuppetDB built-in default.
#### `certificate_whitelist_file`
The name of the certificate whitelist file to set up and configure in PuppetDB. Defaults to `/etc/puppetdb/certificate-whitelist` or `/etc/puppetlabs/puppetdb/certificate-whitelist` for FOSS and PE respectively.
#### `certificate_whitelist`
Array of the X.509 certificate Common Names of clients allowed to connect to PuppetDB. Defaults to empty. Be aware that this permits full access to all Puppet clients to download anything contained in PuppetDB, including the full catalogs of all nodes, which possibly contain sensitive information. Set to `[ $::servername ]` to allow access only from your (single) Puppet master, which is enough for normal operation. Set to a list of Puppet masters if you have multiple.
#### `automatic_dlo_cleanup`
PuppetDB creates [Dead Letter Office](https://puppet.com/docs/puppetdb/5.2/maintain_and_tune.html#clean-up-the-dead-letter-office).
Those are reports of failed requests. They spill up the disk. This parameter is
a boolean and defaults to false. You can enable automatic cleanup of DLO
reports by setting this to true.
#### `cleanup_timer_interval`
The DLO cleanup is a systemd timer if systemd is available, otherwise a
cronjob. The variable configures the systemd.timer option [onCalender](https://www.freedesktop.org/software/systemd/man/systemd.timer.html#OnCalendar=).
It defaults to `*-*-* ${fqdn_rand(24)}:${fqdn_rand(60)}:00`. This will start
the cleanup service on a daily basis. The exact minute and hour is random
per node based on the [fqdn_rand](https://puppet.com/docs/puppet/5.5/function.html#fqdnrand)
method. On non-systemd systems, the cron runs daily and the `$puppetdb_user` needs
to be able to run cron jobs. On systemd systems you need the [camptocamp/systemd](https://forge.puppet.com/camptocamp/systemd)
module, which is an optional dependency and not automatically installed!
#### `dlo_max_age`
This is a positive integer. It describes the amount of days you want to keep
the DLO reports. The default value is 90 days.
### puppetdb::server
The `puppetdb::server` class manages the PuppetDB server independently of the
underlying database that it depends on. It will manage the PuppetDB package,
service, config files, etc., but will still allow you to manage the database
(e.g. PostgreSQL) however you see fit.
class { 'puppetdb::server':
database_host => 'pg1.mydomain.com',
}
### puppetdb::master::config
The `puppetdb::master::config` class directs your Puppet master to use PuppetDB,
which means that this class should be used on your Puppet master node. It’ll
verify that it can successfully communicate with your PuppetDB server, and then
configure your master to use PuppetDB.
Using this class allows the module to manipulate the puppet configuration files
puppet.conf and routes.yaml. The puppet.conf changes are supplemental and should
not affect any of your existing settings, but the routes.yaml file will be
overwritten entirely. If you have an existing routes.yaml file, you will want to
take care to use the `manage_routes` parameter of this class to prevent the module
from managing that file, and you’ll need to manage it yourself.
class { 'puppetdb::master::config':
puppetdb_server => 'my.host.name',
puppetdb_port => 8081,
}
**Parameters within `puppetdb::master::config`:**
#### `puppetdb_server`
The dns name or ip of the PuppetDB server. Defaults to the hostname of the
current node, i.e. `$::fqdn`.
#### `puppetdb_port`
The port that the PuppetDB server is running on. Defaults to `8081`.
#### `puppetdb_disable_ssl`
If true, use plain HTTP to talk to PuppetDB. Defaults to the value of
`disable_ssl` if PuppetDB is on the same server as the Puppet Master, or else
false. If you set this, you probably need to set `puppetdb_port` to match the HTTP
port of the PuppetDB.
#### `puppetdb_soft_write_failure`
Boolean to fail in a soft manner if PuppetDB is not accessible for command
submission Defaults to `false`.
#### `manage_routes`
If `true`, the module will overwrite the Puppet master's routes file to
configure it to use PuppetDB. Defaults to `true`.
#### `manage_storeconfigs`
If `true`, the module will manage the Puppet master's storeconfig settings.
Defaults to `true`.
#### `manage_report_processor`
If `true`, the module will manage the 'reports' field in the puppet.conf file to
enable or disable the PuppetDB report processor. Defaults to `false`.
#### `manage_config`
If `true`, the module will store values from `puppetdb_server` and `puppetdb_port`
parameters in the PuppetDB configuration file. If `false`, an existing PuppetDB
configuration file will be used to retrieve server and port values.
#### `create_puppet_service_resource`
If `true`, AND if `restart_puppet` is true, then the module will create a service
resource for `puppet_service_name` if it has not been defined. Defaults to `true`.
If you are already declaring the `puppet_service_name` service resource in another
part of your code, setting this to `false` will avoid creation of that service
resource by this module, avoiding potential duplicate resource errors.
#### `strict_validation`
If `true`, the module will fail if PuppetDB is not reachable, otherwise it will
preconfigure PuppetDB without checking.
#### `enable_reports`
Ignored unless `manage_report_processor` is `true`, in which case this setting
will determine whether or not the PuppetDB report processor is enabled (`true`)
or disabled (`false`) in the puppet.conf file.
#### `puppet_confdir`
Puppet's config directory. Defaults to `/etc/puppet`.
#### `puppet_conf`
Puppet's config file. Defaults to `/etc/puppet/puppet.conf`.
#### `masterless`
A boolean switch to enable or disable the masterless setup of PuppetDB. Defaults
to `false`.
#### `terminus_package`
Name of the package to use that represents the PuppetDB terminus code. Defaults
to `puppetdb-termini`, when `puppetdb_version` is set to `<= 2.3.x` the default
changes to `puppetdb-terminus`.
#### `puppet_service_name`
Name of the service that represents Puppet. You can change this to `apache2` or
`httpd` depending on your operating system, if you plan on having Puppet run
using Apache/Passenger for example.
#### `puppetdb_startup_timeout`
The maximum amount of time that the module should wait for PuppetDB to start up.
This is most important during the initial install of PuppetDB (defaults to 15
seconds).
#### `restart_puppet`
If `true`, the module will restart the Puppet master when PuppetDB configuration
files are changed by the module. Defaults to `true`. If set to `false`, you
must restart the service manually in order to pick up changes to the config
files (other than `puppet.conf`).
### puppetdb::database::postgresql
The `puppetdb::database::postgresql` class manages a PostgreSQL server for use
by PuppetDB. It can manage the PostgreSQL packages and service, as well as
creating and managing the PuppetDB database and database user accounts.
class { 'puppetdb::database::postgresql':
listen_addresses => 'my.postgres.host.name',
}
#### `listen_addresses`
The `listen_address` is a comma-separated list of hostnames or IP addresses on
which the postgres server should listen for incoming connections. This defaults
to `localhost`. This parameter maps directly to PostgreSQL's `listen_addresses`
config option. Use a `*` to allow connections on any accessible address.
#### `database_name`
Sets the name of the database. Defaults to `puppetdb`.
#### `database_username`
Creates a user for access the database. Defaults to `puppetdb`.
#### `database_password`
Sets the password for the database user above. Defaults to `puppetdb`.
#### `manage_server`
Conditionally manages the PostgreSQL server via `postgresql::server`. Defaults
to `true`. If set to `false`, this class will create the database and user via
`postgresql::server::db` but not attempt to install or manage the server itself.
#### `test_url`
The URL to use for testing if the PuppetDB instance is running. Defaults to
`/pdb/meta/v1/version`.
#### `manage_package_repo`
If `true`, the official postgresql.org repo will be added and postgres won't
be installed from the regular repository. Defaults to `true`.
#### `postgres_version`
If the postgresql.org repo is installed, you can install several versions of
postgres. Defaults to `9.6` in module version 6.0+ and `9.4` in older versions.
Implementation
---------------
### Resource overview
In addition to the classes and variables mentioned above, PuppetDB includes:
**puppetdb::master::routes**
Configures the Puppet master to use PuppetDB as the facts terminus. *WARNING*:
the current implementation simply overwrites your routes.yaml file; if you have
an existing routes.yaml file that you are using for other purposes, you should
*not* use this.
class { 'puppetdb::master::routes':
puppet_confdir => '/etc/puppet'
}
The optional parameter routes can be used to specify a custom route
configuration. For example to configure routes for masterless puppet.
class { 'puppetdb::master::routes':
routes => {
'apply' => {
'facts' => {
'terminus' => 'facter',
'cache' => 'puppetdb_apply',
}
}
}
}
**puppetdb::master::storeconfigs**
Configures the Puppet master to enable storeconfigs and to use PuppetDB as the
storeconfigs backend.
class { 'puppetdb::master::storeconfigs':
puppet_conf => '/etc/puppet/puppet.conf'
}
**puppetdb::server::validate_db**
Validates that a successful database connection can be established between the
node on which this resource is run and the specified PuppetDB database instance
(host/port/user/password/database name).
puppetdb::server::validate_db { 'validate my puppetdb database connection':
database_host => 'my.postgres.host',
database_username => 'mydbuser',
database_password => 'mydbpassword',
database_name => 'mydbname',
}
### Custom Types
**puppetdb_conn_validator**
Verifies that a connection can be successfully established between a node and
the PuppetDB server. Its primary use is as a precondition to prevent
configuration changes from being applied if the PuppetDB server cannot be
reached, but it could potentially be used for other purposes such as monitoring.
Limitations
------------
Currently, PuppetDB is compatible with:
Puppet Version: 4.10+
Platforms:
* EL 5, 6, 7
* Debian 6, 7
* Ubuntu 10.04, 12.04, 14.04
Community Maintained Platforms:
* Archlinux
* OpenBSD 5.6-current and newer
* SLES 11 SP1
Development
------------
Puppet Labs modules on the Puppet Forge are open projects, and community
contributions are essential for keeping them great. We can’t access the huge
number of platforms and myriad of hardware, software, and deployment
configurations that Puppet is intended to serve.
We want to keep it as easy as possible to contribute changes so that our modules
work in your environment. There are a few guidelines that we need contributors
to follow so that we can have a chance of keeping on top of things.
You can read the complete contribution guide
[on the Puppet Labs documentation website](https://docs.puppetlabs.com/contribute.html)