Puppet Class: profile::mediawiki::maintenance

Defined in:
modules/profile/manifests/mediawiki/maintenance.pp

Overview

mediawiki maintenance server



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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'modules/profile/manifests/mediawiki/maintenance.pp', line 2

class profile::mediawiki::maintenance {
    # In order to be able to use the conftool-aware wrapper, we need to access
    # such data easily (on disk).
    require ::profile::conftool::state

    # httpd for noc.wikimedia.org
    class { '::httpd':
        modules => ['rewrite', 'headers'],
    }

    # Set the Server response header to the FQDN. (T255629)
    # Installing libapache2-mod-security2 without also installing modsecurity-crs
    # leads to a syntax error due to a bug in the former package which has
    # an include that is supposed to be optional but isn't optional. --dz 20200803
    package { [ 'libapache2-mod-security2', 'modsecurity-crs']:
        ensure => present
    }
    ::httpd::mod_conf { 'security2':
    }
    ::httpd::conf { 'server_header':
        content  => template('mediawiki/apache/server-header.conf.erb'),
    }

    # Deployment
    include ::scap::scripts

    file { $::mediawiki::scap::mediawiki_staging_dir:
        ensure => link,
        target => '/srv/mediawiki'
    }

    $ensure = mediawiki::state('primary_dc') ? {
        $::site => 'present',
        default => 'absent',
    }

    file { '/usr/local/bin/mw-cli-wrapper':
        source => 'puppet:///modules/profile/mediawiki/maintenance/mw-cli-wrapper.sh',
        owner  => 'root',
        group  => 'root',
        mode   => '0555'
    }

    # MediaWiki maintenance scripts (cron jobs)
    include ::profile::mediawiki::maintenance::wikidata
    include ::profile::mediawiki::maintenance::growthexperiments
    include ::profile::mediawiki::maintenance::pagetriage
    include ::profile::mediawiki::maintenance::translationnotifications
    include ::profile::mediawiki::maintenance::updatetranslationstats
    include ::profile::mediawiki::maintenance::echo_mail_batch
    include ::profile::mediawiki::maintenance::parsercachepurging
    include ::profile::mediawiki::maintenance::cleanup_upload_stash
    include ::profile::mediawiki::maintenance::update_flaggedrev_stats
    include ::profile::mediawiki::maintenance::refreshlinks
    include ::profile::mediawiki::maintenance::update_special_pages
    include ::profile::mediawiki::maintenance::purge_abusefilter
    include ::profile::mediawiki::maintenance::purge_checkuser
    include ::profile::mediawiki::maintenance::purge_expired_userrights
    include ::profile::mediawiki::maintenance::purge_old_cx_drafts
    include ::profile::mediawiki::maintenance::purge_securepoll
    include ::profile::mediawiki::maintenance::db_lag_stats
    include ::profile::mediawiki::maintenance::cirrussearch
    include ::profile::mediawiki::maintenance::generatecaptcha
    include ::profile::mediawiki::maintenance::pageassessments
    class { 'mediawiki::maintenance::uploads': ensure => $ensure }
    include ::profile::mediawiki::maintenance::readinglists
    include ::profile::mediawiki::maintenance::initsitestats
    include ::profile::mediawiki::maintenance::startupregistrystats

    # Include the cache warmup script; requires node and conftool
    require ::profile::conftool::client
    class { '::mediawiki::maintenance::cache_warmup':
        ensure => present,
    }

    # backup home directories to bacula, people work on these
    include ::profile::backup::host
    backup::set {'home': }

    # (T17434) Periodical run of currently disabled special pages
    include ::profile::mediawiki::maintenance::updatequerypages

    # Readline support for PHP maintenance scripts (T126262)
    require_package('php-readline')

    # GNU version of 'time' provides extra info like peak resident memory
    # anomie needs it, as opposed to the shell built-in time command
    require_package('time')

    # T112660 - kafka support
    # The eventlogging code is useful for scripting
    # EventLogging consumers.  Install this but don't
    # run any daemons.  To use eventlogging code,
    # add /srv/deployment/eventlogging/eventlogging
    # to your PYTHONPATH or sys.path.
    include ::eventlogging

    rsync::quickdatacopy { 'home-mwmaint':
        ensure      => present,
        auto_sync   => false,
        source_host => 'mwmaint2001.codfw.wmnet',
        dest_host   => 'mwmaint1002.eqiad.wmnet',
        module_path => '/home',
    }

    # T199124
    $motd_ensure = $ensure ? {
        'present' => 'absent',
        'absent'  => 'present',
        default   => 'present',
    }

    motd::script { 'inactive_warning':
        ensure   => $motd_ensure,
        priority => 1,
        content  => template('profile/mediawiki/maintenance/inactive.motd.erb'),
    }

    rsync::quickdatacopy { 'mwmaint-miscweb':
        ensure      => present,
        auto_sync   => false,
        source_host => 'mwmaint1002.eqiad.wmnet',
        dest_host   => 'miscweb2002.codfw.wmnet',
        module_path => '/home',
    }
}