Merge pull request #127 from dalen/flexible_routes

Allow more flexible routes configuration
This commit is contained in:
Ken Barber 2014-07-01 11:50:00 +01:00
commit cbcf042f54
4 changed files with 26 additions and 8 deletions

View file

@ -436,6 +436,19 @@ Configures the puppet master to use PuppetDB as the facts terminus. *WARNING*: t
puppet_confdir => '/etc/puppet'
}
The optional parameter routes can be used to specify a custom route configuration. For example to configure routes for masterless puppet.
class { 'puppetdb::master::routes':
routes => {
'apply' => {
'facts' => {
'terminus' => 'facter',
'cache' => 'puppetdb_apply',
}
}
}
}
**puppetdb::master::storeconfigs**
Configures the puppet master to enable storeconfigs and to use PuppetDB as the storeconfigs backend.

View file

@ -1,6 +0,0 @@
# This file was automatically generated by the puppetdb module.
master:
facts:
terminus: puppetdb
cache: yaml

View file

@ -2,6 +2,14 @@
# details.
class puppetdb::master::routes(
$puppet_confdir = $puppetdb::params::puppet_confdir,
$routes = {
'master' => {
'facts' => {
'terminus' => 'puppetdb',
'cache' => 'yaml',
}
}
}
) inherits puppetdb::params {
# TODO: this will overwrite any existing routes.yaml;
@ -10,7 +18,7 @@ class puppetdb::master::routes(
# 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,
source => 'puppet:///modules/puppetdb/routes.yaml',
ensure => file,
content => template('puppetdb/routes.yaml.erb'),
}
}

View file

@ -0,0 +1,3 @@
# This file was automatically generated by the puppetdb module.
<%= @routes.to_yaml %>