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
|
# File 'modules/prometheus/manifests/web.pp', line 23
define prometheus::web (
Variant[String,Array] $proxy_pass,
Wmflib::Ensure $ensure = present,
Integer $maxconn = 10,
Boolean $homepage = false,
String $redirect_url = $title,
) {
include ::prometheus
$default_instance = lookup('prometheus::default_web_instance') # lint:ignore:wmf_styleguide
$redirect_to_homepage = ($homepage) or ($title == $default_instance)
# Apache configuration snippet with proxy pass.
$title_safe = regsubst($title, '[\W_]', '-', 'G')
file { "/etc/apache2/prometheus.d/${title_safe}.conf":
ensure => $ensure,
content => template('prometheus/prometheus-apache.erb'),
owner => 'root',
group => 'root',
mode => '0444',
notify => Service['apache2'],
}
# Single prometheus apache site, will include /etc/apache2/prometheus.d/*.conf
if !defined(Httpd::Site['prometheus']) {
httpd::site{ 'prometheus':
content => template('prometheus/prometheus-apache-vhost.erb'),
}
}
}
|