Skip to content

Commit 323c8d0

Browse files
committed
(PDB-4945) Default to json fact cache
Puppetserver 7 now defaults the fact cache to json[1]. When running in agent-server mode, configure routes.yaml the same way. There is no change in behavior when running with puppetserver < 7 or `puppet apply`. As a result of this change, when the puppetdb module is used to install the puppetdb terminus and routes.yaml, facts will now be cached as non-pretty json in: /opt/puppetlabs/server/data/puppetserver/server_data/facts/<node>.json Instead of pretty yaml in: /opt/puppetlabs/server/data/puppetserver/yaml/<node>.yaml The difference in pathing is due to the abstract yaml and json termini using different base directories in which to store data: `Puppet[:yamldir]` vs `Puppet[:server_data]`. [1] https://github.com/puppetlabs/puppetserver/blob/794e725628545aa075e3f8b5fa91f21628373594/src/ruby/puppetserver-lib/puppet/server/puppet_config.rb#L56
1 parent 6d41a24 commit 323c8d0

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

manifests/master/routes.pp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
class puppetdb::master::routes (
44
$puppet_confdir = $puppetdb::params::puppet_confdir,
55
$masterless = $puppetdb::params::masterless,
6-
$routes = {
7-
'master' => {
8-
'facts' => {
9-
'terminus' => 'puppetdb',
10-
'cache' => 'yaml',
11-
}
12-
}
13-
}
6+
$routes = undef,
147
) inherits puppetdb::params {
158

169
if $masterless {
@@ -26,8 +19,22 @@
2619
}
2720
}
2821
}
29-
} else {
22+
} elsif $routes {
3023
$routes_real = $routes
24+
} else {
25+
if versioncmp($serverversion, '7.0') == -1 {
26+
$default_fact_cache = 'yaml'
27+
} else {
28+
$default_fact_cache = 'json'
29+
}
30+
$routes_real = {
31+
'master' => {
32+
'facts' => {
33+
'terminus' => 'puppetdb',
34+
'cache' => $default_fact_cache,
35+
}
36+
}
37+
}
3138
}
3239

3340
# TODO: this will overwrite any existing routes.yaml;

0 commit comments

Comments
 (0)