Puppet Class: mediawiki::jobrunner

Defined in:
puppet/modules/mediawiki/manifests/jobrunner.pp

Overview

Class: mediawiki::jobrunner

jobrunner continuously processes the MediaWiki job queue by dispatching workers to perform tasks and monitoring their success or failure.

Parameters

enable

Enable/disable jobrunner services.

dir

Installation directory.

verbose

Enable verbose logging.

groups

Runner group configuration

Parameters:

  • enable (Any)
  • dir (Any)
  • verbose (Any)
  • groups (Any)


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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'puppet/modules/mediawiki/manifests/jobrunner.pp', line 20

class mediawiki::jobrunner(
    $enable,
    $dir,
    $verbose,
    $groups,
) {
    require ::mediawiki

    $ensure = $enable ? {
        false   => 'absent',
        default => 'present',
    }

    $restart = $enable ? {
        false   => false,
        default => true,
    }

    git::clone { 'mediawiki/services/jobrunner':
        directory => $dir,
        before    => Service['jobrunner'],
    }

    file { '/etc/default/jobrunner':
        content => template('mediawiki/jobrunner.default.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        notify  => [
            Service['jobrunner'],
            Service['jobchron'],
        ],
    }

    file { '/etc/jobrunner.json':
        content => template('mediawiki/jobrunner.json.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        notify  => [
            Service['jobrunner'],
            Service['jobchron'],
        ]
    }

    rsyslog::conf { 'mediawiki-jobrunner':
        source   => 'puppet:///modules/mediawiki/jobrunner-rsyslog.conf',
        priority => 40,
    }


    file { '/etc/logrotate.d/mediawiki_jobrunner':
        source => 'puppet:///modules/mediawiki/logrotate.d_mediawiki_jobrunner',
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
    }

    file { '/etc/logrotate.d/mediawiki_jobchron':
        source => 'puppet:///modules/mediawiki/logrotate.d_mediawiki_jobchron',
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
    }

    service::gitupdate { 'jobrunner':
        dir     => $dir,
        restart => $restart,
        update  => true,
        type    => 'php',
    }

    # jobchron also lives in mediawiki/services/jobrunner, we just use this fake
    # service to restart it after updates.
    # FIXME since updates are in alphabetical order, jobchron will actually be
    #   restarted before the directory is updated. Should probably be replaced
    #   with a systemd dependency.
    service::gitupdate { 'jobchron':
        dir     => $dir,
        pull    => false,
        restart => $restart,
    }

    systemd::service { 'jobrunner':
        ensure  => $ensure,
        require => Mediawiki::Wiki[$::mediawiki::wiki_name],
    }

    systemd::service { 'jobchron':
        ensure  => $ensure,
        require => Mediawiki::Wiki[$::mediawiki::wiki_name],
    }
}