File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,10 +687,9 @@ cronjob. The variable configures the systemd.timer option [onCalender](https://w
687687It defaults to ` *-*-* ${fqdn_rand(24)}:${fqdn_rand(60)}:00 ` . This will start
688688the cleanup service on a daily basis. The exact minute and hour is random
689689per node based on the [ fqdn_rand] ( https://puppet.com/docs/puppet/5.5/function.html#fqdnrand )
690- method. On non-systemd systems, the cron runs daily and you need the
691- [ puppet/cron] ( https://forge.puppet.com/puppet/cron ) module. On systemd systems
692- you need the [ camptocamp/systemd] ( https://forge.puppet.com/camptocamp/systemd )
693- module. Both are optional dependencies and not automatically installed!
690+ method. On non-systemd systems, the cron runs daily and the ` $puppetdb_user ` needs
691+ to be able to run cron jobs. On systemd systems you need the [ camptocamp/systemd] ( https://forge.puppet.com/camptocamp/systemd )
692+ module, which is an optional dependency and not automatically installed!
694693
695694#### ` dlo_max_age `
696695
Original file line number Diff line number Diff line change 304304 active => true ,
305305 }
306306 } else {
307- cron::job {'puppetdb-dlo-cleanup' :
308- ensure => ' present' ,
309- minute => fqdn_rand(60),
310- hour => fqdn_rand(24),
311- date => ' *' ,
312- month => ' *' ,
313- weekday => ' *' ,
314- command => " /usr/bin/find /opt/puppetlabs/server/data/puppetdb/stockpile/discard/ -type f -mtime ${dlo_max_age} -delete" ,
315- user => $puppetdb_user ,
316- description => ' Cleanup old discarded puppetdb reports' ,
307+ cron { 'puppetdb-dlo-cleanup' :
308+ ensure => ' present' ,
309+ minute => fqdn_rand(60),
310+ hour => fqdn_rand(24),
311+ monthday => ' *' ,
312+ month => ' *' ,
313+ weekday => ' *' ,
314+ command => " /usr/bin/find /opt/puppetlabs/server/data/puppetdb/stockpile/discard/ -type f -mtime ${dlo_max_age} -delete" ,
315+ user => $puppetdb_user ,
317316 }
318317 }
319318 }
Original file line number Diff line number Diff line change 8989 it { is_expected . to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.service' ) }
9090 it { is_expected . to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.timer' ) . with_enable ( true ) . with_active ( true ) }
9191
92- it { is_expected . not_to contain_cron__job ( 'puppetdb-dlo-cleanup' ) }
92+ it { is_expected . not_to contain_cron ( 'puppetdb-dlo-cleanup' ) }
9393 end
9494
9595 describe 'dlo cleanup service can be disabled by params' do
101101
102102 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.service' ) }
103103 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.timer' ) }
104- it { is_expected . not_to contain_cron__job ( 'puppetdb-dlo-cleanup' ) }
104+ it { is_expected . not_to contain_cron ( 'puppetdb-dlo-cleanup' ) }
105105 end
106106 end
107107
108108 context 'when systemd is not available' do
109109 describe 'by default dlo cleanup is set up with cron' do
110- it { is_expected . to contain_cron__job ( 'puppetdb-dlo-cleanup' ) . with_ensure ( 'present' ) }
110+ it { is_expected . to contain_cron ( 'puppetdb-dlo-cleanup' ) . with_ensure ( 'present' ) }
111111
112112 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.service' ) }
113113 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.timer' ) }
122122
123123 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.service' ) }
124124 it { is_expected . not_to contain_systemd__unit_file ( 'puppetdb-dlo-cleanup.timer' ) }
125- it { is_expected . not_to contain_cron__job ( 'puppetdb-dlo-cleanup' ) }
125+ it { is_expected . not_to contain_cron ( 'puppetdb-dlo-cleanup' ) }
126126 end
127127 end
128128 end
You can’t perform that action at this time.
0 commit comments