Skip to content

Commit 6a3d8c4

Browse files
authored
Merge pull request #312 from joshcooper/json_fact_cache
(PDB-4945) Default to json fact cache
2 parents 6d41a24 + 8a722ac commit 6a3d8c4

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-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 (defined('$serverversion')) and (versioncmp($serverversion, '7.0') >= 0) {
26+
$default_fact_cache = 'json'
27+
} else {
28+
$default_fact_cache = 'yaml'
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;

spec/unit/classes/master/config_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
operatingsystemrelease: '7.0',
8787
kernel: 'Linux',
8888
selinux: true,
89+
os: {
90+
family: 'RedHat',
91+
name: 'RedHat',
92+
release: { 'full' => '7.0' },
93+
selinux: { 'enabled' => true },
94+
},
8995
}
9096
end
9197
let(:pre_condition) { 'class { "puppetdb::globals": version => "3.1.1-1.el7", }' }
@@ -102,6 +108,12 @@
102108
operatingsystemrelease: '7.0',
103109
kernel: 'Linux',
104110
selinux: true,
111+
os: {
112+
family: 'RedHat',
113+
name: 'RedHat',
114+
release: { 'full' => '7.0' },
115+
selinux: { 'enabled' => true },
116+
},
105117
}
106118
end
107119

0 commit comments

Comments
 (0)