Defined Type: graphite::whisper_cleanup

Defined in:
modules/graphite/manifests/whisper_cleanup.pp

Overview

Parameters:

  • directory (Any)
  • keep_days (Any) (defaults to: 30)
  • user (Any) (defaults to: '_graphite')


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'modules/graphite/manifests/whisper_cleanup.pp', line 9

define graphite::whisper_cleanup (
  $directory,
  $keep_days = 30,
  $user = '_graphite',
) {
    $hour = fqdn_rand(24, $title)
    $minute = fqdn_rand(60, $title)

    systemd::timer::job { $title:
        ensure      => present,
        description => 'Regular jobs for cleanup of whisper directories',
        user        => $user,
        command     => "/usr/local/bin/whisper-cleanup ${directory} ${keep_days}",
        interval    => {'start' => 'OnCalendar', 'interval' => "*-*-* ${hour}:${minute}:00"},
        require     => [
            File['/usr/local/bin/whisper-cleanup']
        ],
    }
}