File: expirer.pp

package info (click to toggle)
puppet-module-panko 13.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 508 kB
  • sloc: ruby: 1,366; python: 40; sh: 15; makefile: 8
file content (60 lines) | stat: -rw-r--r-- 1,226 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# == 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
  }

}