Merge pull request #127 from dalen/flexible_routes
Allow more flexible routes configuration
This commit is contained in:
commit
cbcf042f54
4 changed files with 26 additions and 8 deletions
13
README.md
13
README.md
|
@ -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.
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
# This file was automatically generated by the puppetdb module.
|
||||
|
||||
master:
|
||||
facts:
|
||||
terminus: puppetdb
|
||||
cache: yaml
|
|
@ -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'),
|
||||
}
|
||||
}
|
||||
|
|
3
templates/routes.yaml.erb
Normal file
3
templates/routes.yaml.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
# This file was automatically generated by the puppetdb module.
|
||||
|
||||
<%= @routes.to_yaml %>
|
Loading…
Reference in a new issue