Puppet Class: noc

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

Overview



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
52
53
54
55
56
57
58
59
60
61
62
63
# File 'modules/noc/manifests/init.pp', line 2

class noc {

    # NOC needs a working mediawiki installation at the moment
    # so it will need profile::mediawiki::common to be present.

    httpd::conf { 'define_HHVM':
        conf_type => 'env',
        content   => "export APACHE_ARGUMENTS=\"\$APACHE_ARGUMENTS -D HHVM\"",
    }

    include ::noc::php_engine

    require_package('libapache2-mod-php')

    httpd::site { 'noc.wikimedia.org':
        content => template('noc/noc.wikimedia.org.erb'),
    }

    $fetch_dbconfig_user = 'mwdeploy'
    file { '/srv/dbconfig':
        ensure => directory,
        owner  => $fetch_dbconfig_user,
        group  => $fetch_dbconfig_user,
        mode   => '0755',
    }
    file { '/srv/dbconfig/README':
        ensure  => present,
        content => join(
            [
                'Database configs mirrored from etcd.',
                'This directory is publicly viewable on the web.'],
            '\n'),
        require => File['/srv/dbconfig'],
    }

    $fetch_dbconfig_path = '/usr/local/sbin/fetch_dbconfig'

    file { $fetch_dbconfig_path:
        source => 'puppet:///modules/noc/fetch_dbconfig.sh',
        mode   => '0755',
    }

    systemd::timer::job { 'fetch_dbconfig':
        description     => 'Fetch the dbconfig from etcd and store it locally',
        command         => $fetch_dbconfig_path,
        interval        => {
            'start'    => 'OnUnitInactiveSec',
            'interval' => '60s',
        },
        user            => $fetch_dbconfig_user,
        require         => [File[$fetch_dbconfig_path], File['/srv/dbconfig']],
        logging_enabled => false,
    }

    # Monitoring
    monitoring::service { 'https-noc':
        description   => 'HTTPS-noc',
        check_command => 'check_https_url!noc.wikimedia.org!https://noc.wikimedia.org',
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Noc.wikimedia.org',
    }

}