2013-10-21 17:21:12 +02:00
|
|
|
# Manages the routes configuration file on the master. See README.md for more
|
|
|
|
# details.
|
2014-10-07 16:06:54 +02:00
|
|
|
class puppetdb::master::routes (
|
2012-09-28 20:03:19 +02:00
|
|
|
$puppet_confdir = $puppetdb::params::puppet_confdir,
|
2015-01-15 10:13:51 +01:00
|
|
|
$masterless = $puppetdb::params::masterless,
|
|
|
|
$routes = {
|
2014-05-14 14:06:48 +02:00
|
|
|
'master' => {
|
|
|
|
'facts' => {
|
|
|
|
'terminus' => 'puppetdb',
|
|
|
|
'cache' => 'yaml',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-10-26 20:42:40 +02:00
|
|
|
) inherits puppetdb::params {
|
2012-09-20 23:46:26 +02:00
|
|
|
|
2015-01-15 10:13:51 +01:00
|
|
|
if $masterless {
|
|
|
|
$routes_real = {
|
|
|
|
'apply' => {
|
|
|
|
'catalog' => {
|
|
|
|
'terminus' => 'compiler',
|
|
|
|
'cache' => 'puppetdb',
|
|
|
|
},
|
|
|
|
'facts' => {
|
|
|
|
'terminus' => 'facter',
|
|
|
|
'cache' => 'puppetdb_apply',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$routes_real = $routes
|
|
|
|
}
|
|
|
|
|
2012-09-18 00:26:32 +02:00
|
|
|
# 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":
|
2014-05-14 14:06:48 +02:00
|
|
|
ensure => file,
|
|
|
|
content => template('puppetdb/routes.yaml.erb'),
|
2012-09-18 00:26:32 +02:00
|
|
|
}
|
|
|
|
}
|