Puppet Class: profile::webperf::xhgui

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

Overview

Class: profile::webperf::xhgui

This class is still a work in progress! See phabricator.wikimedia.org/T180761.

Provision XHGui, a graphical interface for XHProf data built on MongoDB. Used by the Performance Team.

See also profile::webperf::site, which provisions a proxy to expose the service at <performance.wikimedia.org/xhgui/>.

Parameters:

  • ldap_config (Any) (defaults to: lookup('ldap', Hash, hash, {}))
  • mysql_host (Any) (defaults to: lookup('profile::webperf::xhgui::mysql_host'))
  • mysql_db (Any) (defaults to: lookup('profile::webperf::xhgui::mysql_db'))
  • mysql_user (Any) (defaults to: lookup('profile::webperf::xhgui::mysql_user'))
  • mysql_password (Any) (defaults to: lookup('profile::webperf::xhgui::mysql_password'))


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

class profile::webperf::xhgui (
    $ldap_config    = lookup('ldap', Hash, hash, {}),
    $mysql_host     = lookup('profile::webperf::xhgui::mysql_host'),
    $mysql_db       = lookup('profile::webperf::xhgui::mysql_db'),
    $mysql_user     = lookup('profile::webperf::xhgui::mysql_user'),
    $mysql_password = lookup('profile::webperf::xhgui::mysql_password'),
) {
    include ::passwords::ldap::production

    # Package xhgui (and dependencies) is built from performance/debs
    require_package('libapache2-mod-php7.3', 'php7.3-mysql')

    # php-twig 1.24.0 is from stretch.  We've rebuilt it for buster but the
    # older version needs to be pinned in order for apt to use it.  (xhgui is
    # not yet compatible with newer versions.)
    if os_version('debian == buster') {
        apt::pin { 'php-twig':
            pin      => 'version 1.*',
            package  => 'php-twig',
            priority => '1001',
            before   => Package['xhgui'],
        }
    }

    package { 'xhgui':
        ensure => 'present',
    }

    ferm::service { 'webperf-xhgui-http':
        proto  => 'tcp',
        port   => '80',
        srange => '$DOMAIN_NETWORKS',
    }

    $auth_ldap = {
        name          => 'nda/ops/wmf',
        bind_dn       => 'cn=proxyagent,ou=profile,dc=wikimedia,dc=org',
        bind_password => $passwords::ldap::production::proxypass,
        url           => "ldaps://${ldap_config[ro-server]} ${ldap_config[ro-server-fallback]}/ou=people,dc=wikimedia,dc=org?cn",
        groups        => [
            'cn=ops,ou=groups,dc=wikimedia,dc=org',
            'cn=nda,ou=groups,dc=wikimedia,dc=org',
            'cn=wmf,ou=groups,dc=wikimedia,dc=org',
        ],
    }

    file { 'config.php':
        ensure  => file,
        path    => '/etc/xhgui/config.php',
        content => template('profile/webperf/xhgui/config.php.erb'),
        owner   => 'www-data',
        mode    => '0600',
        require => Package['xhgui'],
    }

    $webroot_dir = '/usr/share/xhgui/webroot'

    httpd::site { 'xhgui_apache_site':
        content => template('profile/webperf/xhgui/httpd.conf.erb'),
    }
}