Puppet Class: statistics::product_analytics

Defined in:
modules/statistics/manifests/product_analytics.pp

Overview

Class: statistics::product_analytics

Maintainer: Mikhail Popov (bearloga) Team: www.mediawiki.org/wiki/Product_Analytics



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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'modules/statistics/manifests/product_analytics.pp', line 4

class statistics::product_analytics {
    Class['::statistics'] -> Class['::statistics::product_analytics']

    $working_path = $::statistics::working_path
    # Homedir for everything Wikimedia Product Analytics related
    $dir = "${working_path}/product_analytics"
    # Path in which logs will reside
    $log_dir = "${dir}/logs"

    $user = 'analytics-product'
    $group ='analytics-privatedata-users'

    $directories = [
        $dir,
        $log_dir
    ]

    file { $directories:
        ensure => 'directory',
        owner  => $user,
        group  => $group,
        mode   => '0775',
    }

    $jobs_dir = "${dir}/jobs"

    git::clone { 'analytics/wmf-product/jobs':
        ensure             => 'latest',
        branch             => 'master',
        recurse_submodules => true,
        directory          => $jobs_dir,
        owner              => $user,
        group              => $group,
        require            => File[$dir],
    }

    kerberos::systemd_timer { 'product-analytics-movement-metrics':
        ensure                    => 'present',
        description               => 'Product Analytics monthly Movement Metrics run',
        command                   => "${jobs_dir}/movement_metrics/main.sh",
        interval                  => '*-*-9 00:00:00',
        user                      => $user,
        logfile_basedir           => $log_dir,
        logfile_name              => 'monthly_movement_metrics.log',
        logfile_owner             => $user,
        logfile_group             => $group,
        monitoring_enabled        => true,
        monitoring_contact_groups => 'team-product-analytics',
        syslog_force_stop         => true,
        slice                     => 'user.slice',
        require                   => [
            Class['::statistics::compute'],
            Git::Clone['analytics/wmf-product/jobs']
        ],
    }
}