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
42 lines
1.2 KiB
Puppet
42 lines
1.2 KiB
Puppet
# Manages the routes configuration file on the master. See README.md for more
|
|
# details.
|
|
class puppetdb::master::routes (
|
|
$puppet_confdir = $puppetdb::params::puppet_confdir,
|
|
$masterless = $puppetdb::params::masterless,
|
|
$routes = {
|
|
'master' => {
|
|
'facts' => {
|
|
'terminus' => 'puppetdb',
|
|
'cache' => 'yaml',
|
|
}
|
|
}
|
|
}
|
|
) inherits puppetdb::params {
|
|
|
|
if $masterless {
|
|
$routes_real = {
|
|
'apply' => {
|
|
'catalog' => {
|
|
'terminus' => 'compiler',
|
|
'cache' => 'puppetdb',
|
|
},
|
|
'facts' => {
|
|
'terminus' => 'facter',
|
|
'cache' => 'puppetdb_apply',
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
$routes_real = $routes
|
|
}
|
|
|
|
# TODO: this will overwrite any existing routes.yaml;
|
|
# to handle this properly we should just be ensuring
|
|
# that the proper settings exist, but to do that we'd need
|
|
# to parse the yaml file and rewrite it, dealing with indentation issues etc.
|
|
# I don't think there is currently a puppet module or an augeas lens for this.
|
|
file { "${puppet_confdir}/routes.yaml":
|
|
ensure => file,
|
|
content => template('puppetdb/routes.yaml.erb'),
|
|
}
|
|
}
|