Puppet Class: profile::webperf::site

Defined in:
modules/profile/manifests/webperf/site.pp

Overview

Class: profile::webperf::site

This profile provisions <performance.wikimedia.org>, a static site with web performance dashboards.

Parameters

server_name

Server name for the Apache VirtualHost of this site.

arclamp_host

HTTP host address where Arc Lamp artefacts are served (hostname or IP, port allowed). For example “prof.example” or “127.0.0.2:8000”. Optional. If undefined, the “/arclamp” path is not proxied.

xhgui_host

HTTP host address where the XHGui application is served (hostname or IP, port allowed). For example “xhgui.example” or “127.0.0.3:8000”. Optional. If undefined, the “/xhgui” path is not proxied.

xhgui_old_host

HTTP host address where the old, MongoDB-based XHGui application is served. This is a transitional parameter, which will be removed once we've fully migrated to the new MariaDB-based instance. If undefined, “/xhgui-old” is not proxied.

Parameters:

  • server_name (Any) (defaults to: lookup('profile::webperf::site::server_name'))
  • arclamp_host (Any) (defaults to: lookup('arclamp_host'))
  • xhgui_host (Any) (defaults to: lookup('profile::webperf::site::xhgui_host'))
  • xhgui_old_host (Any) (defaults to: lookup('profile::webperf::site::xhgui_old_host'))


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
# File 'modules/profile/manifests/webperf/site.pp', line 27

class profile::webperf::site (
    $server_name = lookup('profile::webperf::site::server_name'),
    $arclamp_host = lookup('arclamp_host'),
    $xhgui_host = lookup('profile::webperf::site::xhgui_host'),
    $xhgui_old_host = lookup('profile::webperf::site::xhgui_old_host')
) {

    require ::profile::webperf::coal_web

    file { '/srv/org':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }

    file { '/srv/org/wikimedia':
        ensure => directory,
        owner  => 'www-data',
        group  => 'www-data',
    }

    git::clone { 'performance/docroot':
        ensure    => latest,
        owner     => 'www-data',
        group     => 'www-data',
        directory => '/srv/org/wikimedia/performance',
        notify    => Service['apache2'],
        require   => Package['apache2']
    }

    # Allow traffic to port 80 from internal networks
    ferm::service { 'performance-website-global':
        proto  => 'tcp',
        port   => '80',
        srange => '$CACHES',
    }

    file { '/var/www/no-robots.txt':
        ensure  => file,
        owner   => 'www-data',
        group   => 'www-data',
        content => file('profile/webperf/site/no-robots.txt'),
    }

    httpd::site { 'performance-wikimedia-org':
        content => template('profile/webperf/site/performance-website.erb'),
        require => Git::Clone['performance/docroot'],
    }

    cron { 'warm_up_coal_cache':
        command => "/bin/bash -c 'for period in day week month year ; do /usr/bin/curl -s -H ${server_name} -o /dev/null \"${::fqdn}/coal/v1/metrics?period=\$period\" ; done'",
        minute  => [0, 30],
        user    => 'nobody',
    }

    require_package('libapache2-mod-uwsgi')
}