Puppet Class: snapshot::cron::categoriesrdf

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

Overview

Parameters:

  • user (Any) (defaults to: undef)
  • filesonly (Any) (defaults to: false)


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
61
62
63
64
65
66
67
68
# File 'modules/snapshot/manifests/cron/categoriesrdf.pp', line 1

class snapshot::cron::categoriesrdf(
    $user      = undef,
    $filesonly = false,
) {
    $confsdir = $snapshot::dumps::dirs::confsdir
    $apachedir =  $snapshot::dumps::dirs::apachedir

    file { '/var/log/categoriesrdf':
        ensure => 'directory',
        mode   => '0644',
        owner  => $user,
    }

    file { '/usr/local/bin/dumpcategoriesrdf-shared.sh':
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/snapshot/cron/dumpcategoriesrdf-shared.sh',
    }

    $scriptpath = '/usr/local/bin/dumpcategoriesrdf.sh'
    file { $scriptpath:
        mode    => '0755',
        owner   => 'root',
        group   => 'root',
        source  => 'puppet:///modules/snapshot/cron/dumpcategoriesrdf.sh',
        require => File['/usr/local/bin/dumpcategoriesrdf-shared.sh'],
    }

    if !$filesonly {
        logrotate::conf { 'categoriesrdf':
            ensure => present,
            source => 'puppet:///modules/snapshot/cron/logrotate.categoriesrdf',
        }

        cron { 'categoriesrdf-dump':
            ensure      => 'present',
            command     => "${scriptpath} --config ${confsdir}/wikidump.conf.other --list ${apachedir}/dblists/categories-rdf.dblist",
            environment => 'MAILTO=ops-dumps@wikimedia.org',
            user        => $user,
            minute      => '0',
            hour        => '20',
            weekday     => '6',
            require     => File[$scriptpath],
        }
    }

    $scriptpath_daily = '/usr/local/bin/dumpcategoriesrdf-daily.sh'
    file { $scriptpath_daily:
        mode    => '0755',
        owner   => 'root',
        group   => 'root',
        source  => 'puppet:///modules/snapshot/cron/dumpcategoriesrdf-daily.sh',
        require => File['/usr/local/bin/dumpcategoriesrdf-shared.sh'],
    }

    if !$filesonly {
        cron { 'categoriesrdf-dump-daily':
            ensure      => 'present',
            command     => "${scriptpath_daily} --config ${confsdir}/wikidump.conf.other --list ${apachedir}/dblists/categories-rdf.dblist",
            environment => 'MAILTO=ops-dumps@wikimedia.org',
            user        => $user,
            minute      => '0',
            hour        => '5',
            require     => File[$scriptpath_daily],
        }
    }
}