5
0
Fork 0
module-puppetdb/manifests/master/routes.pp
Ken Barber b3f685b5e1 (maint) Lint fixes
This patch fixes some of the lint warnings/errors we've been getting on the
forge.

In some cases I've fixed real bugs also, in particular double quotes/single
quotes in cases, which would have broken variable interpolation.

Signed-off-by: Ken Barber <ken@bob.sh>
2015-10-05 13:40:54 -07:00

43 Zeilen
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'),
}
}