Puppet Class: restbase

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

Overview

Class: restbase

RESTBase is a REST API service serving MW content from storage (Cassandra or SQLite, here the latter), proxying requests to various back-end services in case of storage misses.

port

the port RESTBase will be running on

domain

the domain to serve

dbdir

the directory where to place the SQLite database file

log_level

the lowest level to log (trace, debug, info, warn, error, fatal)

eventlogging_service_port

the port of the EventLogging service, default: 8085

Parameters:

  • port (Any)
  • domain (Any)
  • dbdir (Any)
  • log_level (Any) (defaults to: undef)
  • eventlogging_service_port (Any) (defaults to: 8085)


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

class restbase (
    $port,
    $domain,
    $dbdir,
    $log_level = undef,
    $eventlogging_service_port = 8085
) {

    require_package('libsqlite3-dev')

    $parsoid_port = defined(Class['parsoid']) ? {
        true    => $::parsoid::port,
        default => 8000,
    }

    $graphoid_port = defined(Class['graphoid']) ? {
        true    => $::graphoid::port,
        default => 11042,
    }

    $mathoid_port = defined(Class['mathoid']) ? {
        true    => $::mathoid::port,
        default => 10042,
    }

    $mobileapps_port = defined(Class['mobilecontentservice']) ? {
        true    => $::mobilecontentservice::port,
        default => 8888,
    }

    $citoid_port = defined(Class['citoid']) ? {
        true    => $::citoid::port,
        default => 1970,
    }


    $cxserver_port = defined(Class['contenttranslation']) ? {
        true    => $::contenttranslation::cxserver::port,
        default => 8090,
    }

    $pdf_service_port = defined(Class['electron']) ? {
        true    => $::electron::port,
        default => 8098,
    }
    $pdf_service_secret = defined(Class['electron']) ? {
        true    => $::electron::secret,
        default => 'secret',
    }

    file { $dbdir:
        ensure => directory,
        owner  => 'www-data',
        group  => 'www-data',
        mode   => '0775',
        before => Service::Node['restbase'],
    }

    service::node { 'restbase':
        port       => $port,
        module     => 'hyperswitch',
        git_remote => 'https://github.com/wikimedia/restbase.git',
        log_level  => $log_level,
        config     => template('restbase/config.yaml.erb'),
        require    => Package['libsqlite3-dev'],
    }

}