a826d85735
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
29 строки
802 Б
Puppet
29 строки
802 Б
Puppet
# This class configures the puppet master to enable storeconfigs and to use
|
|
# puppetdb as the storeconfigs backend. See README.md for more details.
|
|
class puppetdb::master::storeconfigs (
|
|
$puppet_conf = $puppetdb::params::puppet_conf,
|
|
$masterless = $puppetdb::params::masterless,
|
|
) inherits puppetdb::params {
|
|
|
|
if $masterless {
|
|
$puppet_conf_section = 'main'
|
|
} else {
|
|
$puppet_conf_section = 'master'
|
|
}
|
|
|
|
Ini_setting {
|
|
section => $puppet_conf_section,
|
|
path => $puppet_conf,
|
|
ensure => present,
|
|
}
|
|
|
|
ini_setting { "puppet.conf/${puppet_conf_section}/storeconfigs":
|
|
setting => 'storeconfigs',
|
|
value => true,
|
|
}
|
|
|
|
ini_setting { "puppet.conf/${puppet_conf_section}/storeconfigs_backend":
|
|
setting => 'storeconfigs_backend',
|
|
value => 'puppetdb',
|
|
}
|
|
}
|