54de0d59e5
This sets up a cron task to run periodically and expire panko events in db. Change-Id: I23359239008105cd77a599d2c08c067f132099b7 Partial-Bug: #1746514
61 lines
1.2 KiB
Puppet
61 lines
1.2 KiB
Puppet
#
|
|
# == Class: panko::expirer
|
|
#
|
|
# Setups Panko Expirer service to enable TTL feature.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*enable_cron*]
|
|
# (optional) Whether to configure a crontab entry to run the expiry.
|
|
# When set to False, Puppet will try to remove the crontab.
|
|
# Defaults to true.
|
|
#
|
|
# [*minute*]
|
|
# (optional) Defaults to '1'.
|
|
#
|
|
# [*hour*]
|
|
# (optional) Defaults to '0'.
|
|
#
|
|
# [*monthday*]
|
|
# (optional) Defaults to '*'.
|
|
#
|
|
# [*month*]
|
|
# (optional) Defaults to '*'.
|
|
#
|
|
# [*weekday*]
|
|
# (optional) Defaults to '*'.
|
|
#
|
|
class panko::expirer (
|
|
$enable_cron = true,
|
|
$minute = 1,
|
|
$hour = 0,
|
|
$monthday = '*',
|
|
$month = '*',
|
|
$weekday = '*',
|
|
) {
|
|
|
|
include ::panko::params
|
|
include ::panko::deps
|
|
|
|
Anchor['panko::install::end'] ~> Class['panko::expirer']
|
|
|
|
if $enable_cron {
|
|
$ensure = 'present'
|
|
} else {
|
|
$ensure = 'absent'
|
|
}
|
|
|
|
cron { 'panko-expirer':
|
|
ensure => $ensure,
|
|
command => $panko::params::expirer_command,
|
|
environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
user => 'panko',
|
|
minute => $minute,
|
|
hour => $hour,
|
|
monthday => $monthday,
|
|
month => $month,
|
|
weekday => $weekday
|
|
}
|
|
|
|
}
|