Puppet Class: ocg

Defined in:
puppet/modules/ocg/manifests/init.pp

Overview

Class: ocg

Sets up the OCG service for rendering PDF books from groups of wiki articles. See wikitech for technical documentation.

Parameters

port

Port to listen on

Parameters:

  • port (Any)


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
# File 'puppet/modules/ocg/manifests/init.pp', line 11

class ocg(
    $port,
) {
    include role::restbase

    require_package([
        'texlive-xetex',
        'texlive-latex-recommended',
        'texlive-latex-extra',
        'texlive-generic-extra',
        'texlive-fonts-recommended',
        'texlive-fonts-extra',
        'fonts-hosny-amiri',
        'fonts-farsiweb',
        'fonts-nafees',
        'fonts-arphic-uming',
        'fonts-arphic-ukai',
        'fonts-droid-fallback',
        'fonts-baekmuk',
        'lmodern',
        'texlive-lang-all',
        'latex-xcolor',
        'poppler-utils',
        'imagemagick',
        'librsvg2-bin',
        'libjpeg-progs',
        'djvulibre-bin',
        'unzip',
    ])

    $remote_suffix_hash = {
        mw-ocg-service => '',
        mw-ocg-bundler => '/bundler',
        mw-ocg-latexer => '/latex_renderer',
        mw-ocg-texter  => '/text_renderer',
    }
    $keys = keys($remote_suffix_hash)
    ocg::service{ $keys: hash => $remote_suffix_hash }

    $parsoid_port = $::parsoid::port
    $dir = "${::service::root_dir}/mw-ocg-service"
    $config = "${::service::root_dir}/mw-ocg-service/localsettings.js"
    $log_dir = $::service::log_dir

    file { $config:
        content => template('ocg/localsettings.js.erb'),
        require => Git::Clone['mw-ocg-service'],
    }

    systemd::service { 'mw-ocg-service':
        service_params => {
            subscribe => [ Npm::Install[$dir], File[$config] ],
        },
        require        => Ocg::Service[keys($remote_suffix_hash)],
    }
}