Puppet Class: reportupdater

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

Overview

Class reportupdater

Sets up repositories and rsync for using reportupdater. See: wikitech.wikimedia.org/wiki/Analytics/Reportupdater

Parameters

$user             - string. User for cloning repositories and
                    folder permits.

$base_path        - string. Base path where to put reportupdater's
                    repository, job query repositories, and data output.
                    Default: /srv/reportupdater

Parameters:

  • user (Any)
  • base_path (Any) (defaults to: '/srv/reportupdater')


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

class reportupdater(
    $user,
    $base_path = '/srv/reportupdater',
) {
    $group = 'wikidev'

    # Path at which reportupdater source will be cloned.
    $path = "${base_path}/reportupdater"

    # Path in which all reportupdater output will be stored.
    $output_path = "${base_path}/output"

    # Path in which all reportupdater jobs will log.
    $log_path = "${base_path}/log"

    # Path in which individual reportupdater job repositories
    # will be cloned.
    $job_repositories_path = "${::reportupdater::base_path}/jobs"

    # Ensure these directories exist and are writeable by $user.
    file { [$base_path, $output_path, $log_path, $job_repositories_path]:
        ensure => 'directory',
        owner  => $user,
        group  => $group,
        mode   => '0775',
    }

    # Add logrotate for $log_path/*.log.
    logrotate::conf { 'reportupdater':
        content => template('reportupdater/logrotate.erb'),
        require => File[$log_path],
    }

    # Ensure reportupdater is cloned and latest version.
    git::clone { 'analytics/reportupdater':
        ensure    => 'latest',
        directory => $path,
        origin    => 'https://gerrit.wikimedia.org/r/analytics/reportupdater.git',
        owner     => $user,
        require   => File[$base_path],
    }
}