Puppet Class: profile::alertmanager::web

Defined in:
modules/profile/manifests/alertmanager/web.pp

Overview

Parameters:

  • vhost (String) (defaults to: lookup('profile::alertmanager::web::vhost', {'default_value' => "alerts.${facts['domain']}"}))
  • enable_sso (Boolean) (defaults to: lookup('profile::alertmanager::web::enable_sso', {'default_value' => true}))
  • readonly (Boolean) (defaults to: lookup('profile::alertmanager::web::readonly', {'default_value' => false}))
  • ldap_config (Hash[String, String]) (defaults to: lookup('ldap', {'merge' => 'hash'}))


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
# File 'modules/profile/manifests/alertmanager/web.pp', line 3

class profile::alertmanager::web (
    # lint:ignore:wmf_styleguide - T260574
    String $vhost  = lookup('profile::alertmanager::web::vhost', {'default_value' => "alerts.${facts['domain']}"}),
    # lint:endignore
    Boolean $enable_sso  = lookup('profile::alertmanager::web::enable_sso', {'default_value' => true}),
    Boolean $readonly  = lookup('profile::alertmanager::web::readonly', {'default_value' => false}),
    Hash[String, String] $ldap_config = lookup('ldap', {'merge' => 'hash'}),
) {
    $auth_header = $enable_sso ? {
        true  => 'X-CAS-uid',
        false => undef,
    }

    class { 'alertmanager::karma':
        vhost          => $vhost,
        listen_address => '0.0.0.0',
        listen_port    => 19194,
        auth_header    => $auth_header,
    }

    if $enable_sso {
        profile::idp::client::httpd::site { $vhost:
            document_root   => '/var/www/html',
            acme_chief_cert => 'icinga',
            vhost_content   => 'profile/idp/client/httpd-karma.erb',
            vhost_settings  => { 'readonly' => $readonly },
            required_groups => [
                "cn=ops,${ldap_config['groups_cn']},${ldap_config['base-dn']}",
                "cn=wmf,${ldap_config['groups_cn']},${ldap_config['base-dn']}",
                "cn=nda,${ldap_config['groups_cn']},${ldap_config['base-dn']}",
            ],
        }
    } else {
        httpd::site { $vhost:
            content => template('profile/alertmanager/web.apache.erb'),
        }
    }
}