Puppet Class: snapshot::dumps::cron

Defined in:
modules/snapshot/manifests/dumps/cron.pp

Overview

Parameters:

  • enable (Any) (defaults to: true)
  • user (Any) (defaults to: undef)
  • maxjobs (Any) (defaults to: undef)
  • runtype (Any) (defaults to: undef)


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
# File 'modules/snapshot/manifests/dumps/cron.pp', line 1

class snapshot::dumps::cron(
    $enable = true,
    $user   = undef,
    $maxjobs = undef,
    $runtype = undef,
) {
    if ($enable) {
        $ensure = 'present'
    }
    else {
        $ensure = 'absent'
    }

    file { '/usr/local/bin/fulldumps.sh':
        ensure => 'present',
        path   => '/usr/local/bin/fulldumps.sh',
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/snapshot/dumps/fulldumps.sh',
    }

    file { '/var/log/dumps':
      ensure => 'directory',
      path   => '/var/log/dumps',
      mode   => '0755',
      owner  => $user,
    }

    # fixme there is an implicit dependency on
    # wikidump.conf.dumps plus some stage files, make explicit

    cron { 'fulldumps_rest':
        ensure      => 'present',
        environment => 'MAILTO=ops-dumps@wikimedia.org',
        user        => $user,
        command     => "/usr/local/bin/fulldumps.sh 01 14 ${runtype} full ${maxjobs} > /dev/null",
        minute      => '05',
        hour        => [8, 20],
        monthday    => '01-14',
    }

    cron { 'partialdumps_rest':
        ensure      => 'present',
        environment => 'MAILTO=ops-dumps@wikimedia.org',
        user        => $user,
        command     => "/usr/local/bin/fulldumps.sh 20 25 ${runtype} partial ${maxjobs} > /dev/null",
        minute      => '05',
        hour        => [8, 20],
        monthday    => '20-25',
    }

}