Puppet Class: profile::parsoid

Defined in:
modules/profile/manifests/parsoid.pp

Overview

Parameters:

  • has_lvs (Boolean) (defaults to: hiera('has_lvs', true))
  • port (Integer[1025, 65535]) (defaults to: lookup('profile::parsoid::port', {'default_value' => 8000}))
  • use_php (Boolean) (defaults to: lookup('profile::parsoid::use_php', {'default_value' => 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
# File 'modules/profile/manifests/parsoid.pp', line 1

class profile::parsoid(
    Boolean $has_lvs = hiera('has_lvs', true),
    Integer[1025, 65535] $port = lookup('profile::parsoid::port', {'default_value' => 8000}),
    Boolean $use_php = lookup('profile::parsoid::use_php', {'default_value' => false }),
) {
    if $has_lvs {
        require ::profile::lvs::realserver
    }

    if $use_php {
        require ::profile::mediawiki::php
        require ::profile::mediawiki::php::monitoring
        include ::profile::mediawiki::php::restarts
        require ::profile::mediawiki::webserver
    }

    # On beta $use_php is not set but we still need sudo for restarts (T236275)
    if $use_php or $::realm == 'labs' {
        # Temporarily allow scap3 to restart php-fpm.
        # This is going away, see T236275
        # Also yes, this is all hardcoded as it's going away soon (TM)
        sudo::user { 'scap3_restart_php':
            user       => 'deploy-service',
            privileges => [
                'ALL = (root) NOPASSWD: /usr/local/sbin/restart-php7.2-fpm',
                'ALL = (root) NOPASSWD: /bin/systemctl restart php7.2-fpm',
            ],
        }
    }

    class { '::service::configuration': }

    $mwapi_server = "${::service::configuration::mwapi_host}/w/api.php"
    class { '::parsoid':
        port         => $port,
        mwapi_server => $mwapi_server,
        mwapi_proxy  => '',
    }
}