File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 3030 $other_tables = ' -t producers -t resource_params -t resource_params_cache"'
3131 $reports_table = ' -t reports"'
3232 $resource_events_table = ' -t resource_events"'
33+ $catalog_inputs_table = ' -t catalog_inputs"'
3334
3435 Cron {
3536 ensure => $ensure_cron ,
5859 command => " ${repack} ${repack_jobs} ${other_tables} > ${logging_directory} /other_repack.log 2>&1" ,
5960 }
6061
62+ if versioncmp($facts [' pe_server_version' ], ' 2019.8.0' ) >= 0 {
63+ cron { ' pg_repack catalog_inputs tables' :
64+ monthday => 5,
65+ hour => 5,
66+ minute => 30,
67+ command => " ${repack} ${repack_jobs} ${catalog_inputs_table} > ${logging_directory} /catalog_inputs_repack.log 2>&1" ,
68+ }
69+ }
70+ else {
71+ cron { ' pg_repack catalog_inputs tables' :
72+ ensure => ' absent' ,
73+ }
74+ }
75+
6176 if versioncmp($facts [' pe_server_version' ], ' 2019.7.0' ) < 0 {
6277 cron { ' pg_repack reports tables' :
6378 monthday => 10,
Original file line number Diff line number Diff line change 7171 ' -d pe-puppetdb --jobs 2 -t resource_events" > /var/log/puppetlabs/pe_databases_cron/resource_events_repack.log 2>&1' )
7272 }
7373 end
74+ context 'on >= PE 2019.8.0' do
75+ before :each do
76+ facts [ 'pe_server_version' ] = '2019.8.0'
77+ facts [ 'pe_postgresql_info' ] [ 'installed_server_version' ] = 11
78+ end
79+ it {
80+ is_expected . to contain_cron ( 'pg_repack catalog_inputs tables' )
81+ . with_command ( 'su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/apps/postgresql/11/bin/pg_repack' \
82+ ' -d pe-puppetdb --jobs 2 -t catalog_inputs" > /var/log/puppetlabs/pe_databases_cron/catalog_inputs_repack.log 2>&1' )
83+ }
84+ end
7485 end
7586 end
7687end
You can’t perform that action at this time.
0 commit comments