Puppet Class: snapshot::systemdjobs::categoriesrdf

Defined in:
modules/snapshot/manifests/systemdjobs/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
69
70
71
# File 'modules/snapshot/manifests/systemdjobs/categoriesrdf.pp', line 1

class snapshot::systemdjobs::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/systemdjobs/dumpcategoriesrdf-shared.sh',
    }

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

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

        systemd::timer::job { 'categoriesrdf-dump':
            ensure             => present,
            description        => 'Regular jobs to build rdf snapshot of categories',
            user               => $user,
            monitoring_enabled => false,
            send_mail          => true,
            environment        => {'MAILTO' => 'ops-dumps@wikimedia.org'},
            command            => "${scriptpath} --config ${confsdir}/wikidump.conf.other --list ${apachedir}/dblists/categories-rdf.dblist",
            interval           => {'start' => 'OnCalendar', 'interval' => 'Sat *-*-* 20:0:0'},
            require            => File[$scriptpath],
        }
    }

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

    if !$filesonly {
        systemd::timer::job { 'categoriesrdf-dump-daily':
            ensure             => present,
            description        => 'Regular jobs to build daily rdf snapshot of categories',
            user               => $user,
            monitoring_enabled => false,
            send_mail          => true,
            environment        => {'MAILTO' => 'ops-dumps@wikimedia.org'},
            command            => "${scriptpath_daily} --config ${confsdir}/wikidump.conf.other --list ${apachedir}/dblists/categories-rdf.dblist",
            interval           => {'start' => 'OnCalendar', 'interval' => '*-*-* 5:0:0'},
            require            => File[$scriptpath_daily],
        }
    }
}