Puppet Class: profile::alertmanager

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • active_host (Stdlib::Host) (defaults to: lookup('profile::alertmanager::active_host'))
  • partners (Array[Stdlib::Host]) (defaults to: lookup('profile::alertmanager::partners'))
  • grafana_hosts (Array[Stdlib::Host]) (defaults to: lookup('profile::alertmanager::grafana_hosts', { 'default_value' => [] }))
  • thanos_query_hosts (Array[Stdlib::Host]) (defaults to: lookup('profile::alertmanager::thanos_query_hosts', { 'default_value' => [] }))
  • irc_channel (String) (defaults to: lookup('profile::alertmanager::irc::channel'))
  • victorops_api_key (Optional[String]) (defaults to: lookup('profile::alertmanager::victorops_api_key'))
  • prometheus_all_nodes (Array) (defaults to: lookup('prometheus_all_nodes'))
  • vhost (String) (defaults to: lookup('profile::alertmanager::web::vhost', {'default_value' => "alerts.${facts['domain']}"}))
  • sink_notifications (Optional[Boolean]) (defaults to: lookup('profile::alertmanager::sink_notifications', { 'default_value' => false }))


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

class profile::alertmanager (
    Stdlib::Host        $active_host = lookup('profile::alertmanager::active_host'),
    Array[Stdlib::Host] $partners    = lookup('profile::alertmanager::partners'),
    Array[Stdlib::Host] $grafana_hosts = lookup('profile::alertmanager::grafana_hosts', { 'default_value' => [] }),
    Array[Stdlib::Host] $thanos_query_hosts = lookup('profile::alertmanager::thanos_query_hosts', { 'default_value' => [] }),
    String              $irc_channel = lookup('profile::alertmanager::irc::channel'),
    Optional[String]    $victorops_api_key = lookup('profile::alertmanager::victorops_api_key'),
    Array $prometheus_all_nodes = lookup('prometheus_all_nodes'),
    # lint:ignore:wmf_styleguide - T260574
    String $vhost  = lookup('profile::alertmanager::web::vhost', {'default_value' => "alerts.${facts['domain']}"}),
    # lint:endignore
    Optional[Boolean]   $sink_notifications = lookup('profile::alertmanager::sink_notifications', { 'default_value' => false }),
) {
    class { '::alertmanager':
        irc_channel        => $irc_channel,
        active_host        => $active_host,
        partners           => $partners,
        victorops_api_key  => $victorops_api_key,
        vhost              => $vhost,
        sink_notifications => $sink_notifications,
    }

    # All Prometheus servers need access to Alertmanager to send alerts
    firewall::service { 'alertmanager-prometheus':
        proto  => 'tcp',
        port   => 9093,
        srange => $prometheus_all_nodes + $grafana_hosts + $thanos_query_hosts,
    }

    firewall::service{ 'alertmanager-cluster':
        proto  => 'tcp',
        port   => 9094,
        srange => $partners + $active_host,
    }
}