Puppet Class: testreduce

Defined in:
modules/testreduce/manifests/init.pp

Overview

Class: testreduce

This file provides the testreduce code repository



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
# File 'modules/testreduce/manifests/init.pp', line 5

class testreduce {

    if os_version('debian == stretch') {

        apt::repository { 'stretch-node10':
            uri        => 'http://apt.wikimedia.org/wikimedia',
            dist       => 'stretch-wikimedia',
            components => 'component/node10',
            before     => Package['nodejs'],
        }

        $node_packages = ['nodejs', 'nodejs-dev', 'node-abbrev', 'node-ansi-regex',
                      'node-cacache', 'node-config-chain', 'node-glob', 'node-hosted-git-info',
                      'node-ini node-npm-package-arg', 'node-jsonstream',
                      'node-libnpx', 'node-lockfile', 'node-lru-cache',
                      'node-move-concurrently', 'node-normalize', 'package-data',
                      'node-gyp', 'node-resolve-from', 'node-npmlog', 'node-osenv',
                      'node-read-package-json', 'node-request', 'node-retry',
                      'node-rimraf', 'node-semver', 'node-sha', 'node-slide',
                      'node-strip-ansi', 'node-tar', 'node-boxen', 'node-which']

        $pinned_packages = join($node_packages, ' ')

        apt::pin { 'node10-stretch-wikimedia':
            package  => $pinned_packages,
            pin      => 'release a=stretch-wikimedia',
            priority => 1005,
            before   => Package['nodejs'],
        }
    }

    ensure_packages(['nodejs', 'npm'])

    group { 'testreduce':
        ensure => present,
        system => true,
    }

    user { 'testreduce':
        gid        => 'testreduce',
        home       => '/srv/testreduce',
        managehome => false,
        system     => true,
    }

    file { '/var/log/testreduce':
        ensure => directory,
        owner  => 'testreduce',
        group  => 'testreduce',
        mode   => '0755',
    }

    file { '/etc/testreduce':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    git::clone { 'mediawiki/services/parsoid/testreduce':
        branch    => 'ruthenium',
        owner     => 'root',
        group     => 'wikidev',
        directory => '/srv/testreduce',
        # FIXME: Is this notification required?
        # There can be multiple services that might
        # be instantiated using the code from this
        # repository. The only way to notify all those
        # services would be hardcode all their names here.
        #
        # notify    => Service[$instance_name],
    }
}