Skip to content

Commit cbcf042

Browse files
committed
Merge pull request #127 from dalen/flexible_routes
Allow more flexible routes configuration
2 parents c706255 + 32deceb commit cbcf042

4 files changed

Lines changed: 26 additions & 8 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,19 @@ Configures the puppet master to use PuppetDB as the facts terminus. *WARNING*: t
436436
puppet_confdir => '/etc/puppet'
437437
}
438438

439+
The optional parameter routes can be used to specify a custom route configuration. For example to configure routes for masterless puppet.
440+
441+
class { 'puppetdb::master::routes':
442+
routes => {
443+
'apply' => {
444+
'facts' => {
445+
'terminus' => 'facter',
446+
'cache' => 'puppetdb_apply',
447+
}
448+
}
449+
}
450+
}
451+
439452
**puppetdb::master::storeconfigs**
440453

441454
Configures the puppet master to enable storeconfigs and to use PuppetDB as the storeconfigs backend.

files/routes.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

manifests/master/routes.pp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
# details.
33
class puppetdb::master::routes(
44
$puppet_confdir = $puppetdb::params::puppet_confdir,
5+
$routes = {
6+
'master' => {
7+
'facts' => {
8+
'terminus' => 'puppetdb',
9+
'cache' => 'yaml',
10+
}
11+
}
12+
}
513
) inherits puppetdb::params {
614

715
# TODO: this will overwrite any existing routes.yaml;
@@ -10,7 +18,7 @@
1018
# to parse the yaml file and rewrite it, dealing with indentation issues etc.
1119
# I don't think there is currently a puppet module or an augeas lens for this.
1220
file { "${puppet_confdir}/routes.yaml":
13-
ensure => file,
14-
source => 'puppet:///modules/puppetdb/routes.yaml',
21+
ensure => file,
22+
content => template('puppetdb/routes.yaml.erb'),
1523
}
1624
}

templates/routes.yaml.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file was automatically generated by the puppetdb module.
2+
3+
<%= @routes.to_yaml %>

0 commit comments

Comments
 (0)