Defined Type: prometheus::web

Defined in:
modules/prometheus/manifests/web.pp

Overview

Parameters:

  • proxy_pass (String)
  • ensure (Wmflib::Ensure) (defaults to: present)
  • maxconn (Integer) (defaults to: 10)
  • homepage (Boolean) (defaults to: false)
  • redirect_url (String) (defaults to: $title)


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
# File 'modules/prometheus/manifests/web.pp', line 23

define prometheus::web (
    String $proxy_pass,
    Wmflib::Ensure $ensure = present,
    Integer $maxconn = 10,
    Boolean $homepage = false,
    String $redirect_url = $title,
) {
    include ::prometheus

    # Previously installed hosts with this class used nginx;
    #  turn off and remove nginx to avoid collisions
    #  on port 80.
    if !defined(Class['::nginx']) {
        class { '::nginx':
            ensure => absent,
        }
    }

    # 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',
    }

    # Single prometheus apache site, will include /etc/prometheus-apache/*.conf
    if !defined(Httpd::Site['prometheus']) {
        httpd::site{ 'prometheus':
            content => template('prometheus/prometheus-apache-vhost.erb'),
        }
    }
}