Puppet Class: profile::alertmanager::api

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

Overview

Parameters:

  • vhost (String) (defaults to: lookup('profile::alertmanager::api::vhost', {'default_value' => "alertmanager.${facts['domain']}"}))
  • vhost_alias (Optional[String]) (defaults to: lookup('profile::alertmanager::api::vhost_alias', {'default_value' => undef}))
  • ro (Array[Httpd::RequireHostIP]) (defaults to: lookup('profile::alertmanager::api::ro'))
  • rw (Array[Httpd::RequireHostIP]) (defaults to: lookup('profile::alertmanager::api::rw'))
  • alertmanagers (Array[Httpd::RequireHostIP]) (defaults to: lookup('alertmanagers'))


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

class profile::alertmanager::api (
    # lint:ignore:wmf_styleguide - T260574
    String $vhost  = lookup('profile::alertmanager::api::vhost', {'default_value' => "alertmanager.${facts['domain']}"}),
    Optional[String] $vhost_alias  = lookup('profile::alertmanager::api::vhost_alias', {'default_value' => undef}),
    # lint:endignore
    Array[Httpd::RequireHostIP] $ro = lookup('profile::alertmanager::api::ro'),
    Array[Httpd::RequireHostIP] $rw = lookup('profile::alertmanager::api::rw'),
    Array[Httpd::RequireHostIP] $alertmanagers = lookup('alertmanagers'),
) {

    $ro_hosts = $ro.filter |$el| { $el =~ Stdlib::Fqdn }
    $ro_ips = $ro.filter |$el|   { $el =~ Stdlib::IP::Address }
    $rw_hosts = $rw.filter |$el| { $el =~ Stdlib::Fqdn }
    $rw_ips = $rw.filter |$el|   { $el =~ Stdlib::IP::Address }
    $am_hosts = $alertmanagers.filter |$el| { $el =~ Stdlib::Fqdn }
    $am_ips = $alertmanagers.filter |$el|   { $el =~ Stdlib::IP::Address }

    httpd::site { $vhost:
        content => template('profile/alertmanager/api.apache.erb'),
    }

    package { 'libapache2-mod-security2':
        ensure => present
    }

    httpd::mod_conf { 'security2':
    }
}