File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 $node_ttl = $puppetdb::params::node_ttl,
3939 $node_purge_ttl = $puppetdb::params::node_purge_ttl,
4040 $report_ttl = $puppetdb::params::report_ttl,
41+ Optional[Array] $facts_blacklist = $puppetdb::params::facts_blacklist,
4142 $gc_interval = $puppetdb::params::gc_interval,
4243 $log_slow_statements = $puppetdb::params::log_slow_statements,
4344 $conn_max_age = $puppetdb::params::conn_max_age,
114115 node_ttl => $node_ttl ,
115116 node_purge_ttl => $node_purge_ttl ,
116117 report_ttl => $report_ttl ,
118+ facts_blacklist => $facts_blacklist ,
117119 gc_interval => $gc_interval ,
118120 log_slow_statements => $log_slow_statements ,
119121 conn_max_age => $conn_max_age ,
Original file line number Diff line number Diff line change 4242 $node_purge_ttl = ' 14d'
4343 $report_ttl = ' 14d'
4444
45+ $facts_blacklist = undef
46+
4547 $gc_interval = ' 60'
4648
4749 $log_slow_statements = ' 10'
Original file line number Diff line number Diff line change 3232 $node_ttl = $puppetdb::params::node_ttl,
3333 $node_purge_ttl = $puppetdb::params::node_purge_ttl,
3434 $report_ttl = $puppetdb::params::report_ttl,
35+ Optional[Array] $facts_blacklist = $puppetdb::params::facts_blacklist,
3536 $gc_interval = $puppetdb::params::gc_interval,
3637 $log_slow_statements = $puppetdb::params::log_slow_statements,
3738 $conn_max_age = $puppetdb::params::conn_max_age,
171172 node_ttl => $node_ttl ,
172173 node_purge_ttl => $node_purge_ttl ,
173174 report_ttl => $report_ttl ,
175+ facts_blacklist => $facts_blacklist ,
174176 gc_interval => $gc_interval ,
175177 log_slow_statements => $log_slow_statements ,
176178 conn_max_age => $conn_max_age ,
Original file line number Diff line number Diff line change 1313 $node_ttl = $puppetdb::params::node_ttl,
1414 $node_purge_ttl = $puppetdb::params::node_purge_ttl,
1515 $report_ttl = $puppetdb::params::report_ttl,
16+ $facts_blacklist = $puppetdb::params::facts_blacklist,
1617 $gc_interval = $puppetdb::params::gc_interval,
1718 $log_slow_statements = $puppetdb::params::log_slow_statements,
1819 $conn_max_age = $puppetdb::params::conn_max_age,
171172 }
172173 }
173174 }
175+
176+ if ($facts_blacklist ) and length($facts_blacklist ) != 0 {
177+ $joined_facts_blacklist = join($facts_blacklist , ' , ' )
178+ ini_setting { 'puppetdb_facts_blacklist' :
179+ setting => ' facts-blacklist' ,
180+ value => $joined_facts_blacklist ,
181+ }
182+ } else {
183+ ini_setting { 'puppetdb_facts_blacklist' :
184+ ensure => absent ,
185+ setting => ' facts-blacklist' ,
186+ }
187+ }
188+
174189}
Original file line number Diff line number Diff line change 155155 )
156156 }
157157 it { is_expected . not_to contain_ini_setting ( 'puppetdb_database_max_pool_size' ) }
158+ it {
159+ is_expected . to contain_ini_setting ( 'puppetdb_facts_blacklist' )
160+ . with (
161+ 'ensure' => 'absent' ,
162+ 'path' => '/etc/puppetlabs/puppetdb/conf.d/database.ini' ,
163+ 'section' => 'database' ,
164+ 'setting' => 'facts-blacklist' ,
165+ )
166+ }
167+ end
168+
169+ describe 'when using facts_blacklist' do
170+ let ( :params ) do
171+ {
172+ 'facts_blacklist' => [
173+ 'one_fact' ,
174+ 'another_fact' ,
175+ ] ,
176+ }
177+ end
178+
179+ it {
180+ is_expected . to contain_ini_setting ( 'puppetdb_facts_blacklist' )
181+ . with (
182+ 'ensure' => 'present' ,
183+ 'path' => '/etc/puppetlabs/puppetdb/conf.d/database.ini' ,
184+ 'section' => 'database' ,
185+ 'setting' => 'facts-blacklist' ,
186+ 'value' => 'one_fact, another_fact' ,
187+ )
188+ }
158189 end
159190
160191 describe 'when using a legacy PuppetDB version' do
You can’t perform that action at this time.
0 commit comments