Skip to content

Commit 1603855

Browse files
authored
Merge pull request #257 from syseleven/add-disable-update-checking
Add disable-update-checking parameter
2 parents 164c35f + 7f502ef commit 1603855

6 files changed

Lines changed: 47 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,11 @@ Defaults to `undef`, using the PuppetDB built-in default.
675675
The amount of disk space (in MB) to allow for temporary message storage.
676676
Defaults to `undef`, using the PuppetDB built-in default.
677677

678+
####`disable_update_checking`
679+
680+
Setting this to true disables checking for updated versions of PuppetDB and sending basic analytics data to Puppet.
681+
Defaults to `undef`, using the PuppetDB built-in default.
682+
678683
####`certificate_whitelist_file`
679684

680685
The name of the certificate whitelist file to set up and configure in PuppetDB. Defaults to `/etc/puppetdb/certificate-whitelist` or `/etc/puppetlabs/puppetdb/certificate-whitelist` for FOSS and PE respectively.

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
$concurrent_writes = $puppetdb::params::concurrent_writes,
7171
$store_usage = $puppetdb::params::store_usage,
7272
$temp_usage = $puppetdb::params::temp_usage,
73+
$disable_update_checking = $puppetdb::params::disable_update_checking,
7374
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
7475
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
7576
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
@@ -142,6 +143,7 @@
142143
concurrent_writes => $concurrent_writes,
143144
store_usage => $store_usage,
144145
temp_usage => $temp_usage,
146+
disable_update_checking => $disable_update_checking,
145147
certificate_whitelist_file => $certificate_whitelist_file,
146148
certificate_whitelist => $certificate_whitelist,
147149
database_max_pool_size => $database_max_pool_size,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
$concurrent_writes = undef
168168
$store_usage = undef
169169
$temp_usage = undef
170+
$disable_update_checking = undef
170171

171172
$ssl_set_cert_paths = false
172173
$ssl_cert_path = "${ssl_dir}/public.pem"

manifests/server.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
$concurrent_writes = $puppetdb::params::concurrent_writes,
6666
$store_usage = $puppetdb::params::store_usage,
6767
$temp_usage = $puppetdb::params::temp_usage,
68+
$disable_update_checking = $puppetdb::params::disable_update_checking,
6869
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
6970
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
7071
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
@@ -266,6 +267,7 @@
266267
class { 'puppetdb::server::puppetdb':
267268
certificate_whitelist_file => $certificate_whitelist_file,
268269
certificate_whitelist => $certificate_whitelist,
270+
disable_update_checking => $disable_update_checking,
269271
confdir => $confdir,
270272
puppetdb_user => $puppetdb_user,
271273
puppetdb_group => $puppetdb_group,

manifests/server/puppetdb.pp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
class puppetdb::server::puppetdb (
33
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
44
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
5+
$disable_update_checking = $puppetdb::params::disable_update_checking,
56
$confdir = $puppetdb::params::confdir,
67
$puppetdb_user = $puppetdb::params::puppetdb_user,
78
$puppetdb_group = $puppetdb::params::puppetdb_group,
@@ -44,4 +45,16 @@
4445
owner => 0,
4546
group => 0,
4647
}
48+
49+
if $disable_update_checking {
50+
ini_setting { 'puppetdb_disable_update_checking':
51+
setting => 'disable-update-checking',
52+
value => $disable_update_checking,
53+
}
54+
} else {
55+
ini_setting { 'puppetdb_disable_update_checking':
56+
ensure => 'absent',
57+
setting => 'disable-update-checking',
58+
}
59+
}
4760
}

spec/unit/classes/server/puppetdb_ini_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
'group' => 'puppetdb',
3636
'mode' => '0600'
3737
)}
38+
it { should contain_ini_setting('puppetdb_disable_update_checking').
39+
with(
40+
'ensure' => 'absent',
41+
'path' => '/etc/puppetlabs/puppetdb/conf.d/puppetdb.ini',
42+
'section' => 'puppetdb',
43+
'setting' => 'disable-update-checking'
44+
)}
3845
end
3946

4047
describe 'when restricting access to puppetdb' do
@@ -60,5 +67,22 @@
6067
'content' => "puppetmaster\n"
6168
)}
6269
end
70+
71+
describe 'when enable disable-update-checking' do
72+
let(:params) do
73+
{
74+
'disable_update_checking' => true,
75+
}
76+
end
77+
78+
it { should contain_ini_setting('puppetdb_disable_update_checking').
79+
with(
80+
'ensure' => 'present',
81+
'path' => '/etc/puppetlabs/puppetdb/conf.d/puppetdb.ini',
82+
'section' => 'puppetdb',
83+
'setting' => 'disable-update-checking',
84+
'value' => 'true'
85+
)}
86+
end
6387
end
6488
end

0 commit comments

Comments
 (0)