Puppet Class: toolforge::toolviews

Defined in:
modules/toolforge/manifests/toolviews.pp

Overview

Process dynamicproxy access logs to compute usage data for Toolforge tools.

Parameters:

  • mysql_host (Any)
  • mysql_db (Any)
  • mysql_user (Any)
  • mysql_password (Any)


2
3
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
# File 'modules/toolforge/manifests/toolviews.pp', line 2

class toolforge::toolviews (
    $mysql_host,
    $mysql_db,
    $mysql_user,
    $mysql_password,
) {
    require_package(
        'python3-ldap3',
        'python3-pymysql',
        'python3-yaml',
    )

    file { '/etc/toolviews.yaml':
        ensure  => file,
        content => template('toolforge/toolviews.yaml.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0400',
    }

    file { '/usr/local/bin/toolviews.py':
        ensure  => file,
        source  => 'puppet:///modules/toolforge/toolviews.py',
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        require => Package[
            'python3-ldap3',
            'python3-pymysql',
            'python3-yaml',
        ],
    }

    # See the custom nginx logrotate config in ::dynamicproxy for how this is
    # triggered.
    file { '/etc/logrotate.d/nginx-postrotate':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }
    file { '/etc/logrotate.d/nginx-postrotate/toolviews':
        ensure  => file,
        source  => 'puppet:///modules/toolforge/toolviews.sh',
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        require => File['/usr/local/bin/toolviews.py'],
    }
}