module-puppetdb/manifests/master/report_processor.pp
Yanis Guenane a826d85735 Allow puppetdb to be configure for masterless conf
Currently the module only allows PuppetDB to be configured in a
agent/master setup configuration, by configuring the master section of
the puppet.conf and applying on the routes for such a configuration.
This commit allows one to use this module to configure the main section of
the puppet.conf and applying the proper routes so the module can configure
nodes to use PuppetDB in a masterless setup.

Doc about puppet.conf configure in masterless way available here
https://docs.puppetlabs.com/puppetdb/2.2/connect_puppet_apply.html#manage-puppetconf
2015-02-05 06:31:54 -05:00

26 lines
756 B
Puppet

# Manage the installation of the report processor on the master. See README.md
# for more details.
class puppetdb::master::report_processor (
$puppet_conf = $puppetdb::params::puppet_conf,
$masterless = $puppetdb::params::masterless,
$enable = false
) inherits puppetdb::params {
if $masterless {
$puppet_conf_section = 'main'
} else {
$puppet_conf_section = 'master'
}
ini_subsetting { 'puppet.conf/reports/puppetdb':
ensure => $enable ? {
true => present,
default => absent
},
path => $puppet_conf,
section => $puppet_conf_section,
setting => 'reports',
subsetting => 'puppetdb',
subsetting_separator => ',',
}
}