Puppet Class: profile::librenms::web

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

Summary

profile to configure librenms website

Overview

SPDX-License-Identifier: Apache-2.0



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

class profile::librenms::web {

    require profile::librenms

    $sitename       = $profile::librenms::sitename
    $install_dir    = $profile::librenms::install_dir
    $active_server  = $profile::librenms::active_server
    $auth_mechanism = $profile::librenms::auth_mechanism
    $ssl_settings   = ssl_ciphersuite('apache', 'strong', true)

    acme_chief::cert { 'librenms':
        puppet_svc => 'apache2',
    }

    if $auth_mechanism == 'sso' {
        include profile::idp::client::httpd
    } else {
        httpd::site { $sitename:
            content => template('profile/librenms/apache.conf.erb'),
        }
    }


    $monitoring_ensure = $active_server ? {
        $facts['fqdn'] => 'present',
        default        => 'absent',
    }

    monitoring::service { 'https':
        ensure        => $monitoring_ensure,
        description   => 'HTTPS',
        check_command => 'check_ssl_http_letsencrypt!librenms.wikimedia.org',
        notes_url     => 'https://wikitech.wikimedia.org/wiki/LibreNMS',
    }

    monitoring::service { 'librenms':
        ensure        => $monitoring_ensure,
        description   => 'LibreNMS HTTPS',
        check_command => "check_https_url!${sitename}!http://${sitename}",
        notes_url     => 'https://wikitech.wikimedia.org/wiki/LibreNMS',
    }
    monitoring::service { 'librenms-ssl-expiry':
        ensure        => $monitoring_ensure,
        description   => 'LibreNMS HTTPS sl expiry',
        check_command => "check_https_expiry!${sitename}!443",
        notes_url     => 'https://wikitech.wikimedia.org/wiki/LibreNMS',
    }
}