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
|
# File 'modules/profile/manifests/alertmanager/web.pp', line 4
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}),
Optional[String[1]] $metricsinfra_username = lookup('profile::alertmanager::web::metricsinfra_username', {'default_value' => undef}),
Optional[String[1]] $metricsinfra_password = lookup('profile::alertmanager::web::metricsinfra_password', {'default_value' => undef}),
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,
metricsinfra_username => $metricsinfra_username,
metricsinfra_password => $metricsinfra_password,
}
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=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'),
}
}
}
|