Puppet Class: profile::alertmanager::irc

Defined in:
modules/profile/manifests/alertmanager/irc.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'))
  • irc_host (Stdlib::Host) (defaults to: lookup('profile::alertmanager::irc::host'))
  • irc_port (Stdlib::Port) (defaults to: lookup('profile::alertmanager::irc::port'))
  • irc_nickname (String) (defaults to: lookup('profile::alertmanager::irc::nickname'))
  • irc_realname (String) (defaults to: lookup('profile::alertmanager::irc::realname'))
  • irc_nickname_password (String) (defaults to: lookup('profile::alertmanager::irc::nickname_password'))
  • vhost (String) (defaults to: lookup('profile::alertmanager::web::vhost'))


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

class profile::alertmanager::irc (
    Stdlib::Host        $active_host = lookup('profile::alertmanager::active_host'),
    Array[Stdlib::Host] $partners    = lookup('profile::alertmanager::partners'),
    Stdlib::Host        $irc_host    = lookup('profile::alertmanager::irc::host'),
    Stdlib::Port        $irc_port    = lookup('profile::alertmanager::irc::port'),
    String              $irc_nickname = lookup('profile::alertmanager::irc::nickname'),
    String              $irc_realname = lookup('profile::alertmanager::irc::realname'),
    String              $irc_nickname_password = lookup('profile::alertmanager::irc::nickname_password'),
    String              $vhost = lookup('profile::alertmanager::web::vhost'),
) {
    if $active_host == $::fqdn {
        $irc_ensure = running
    } else {
        $irc_ensure = stopped
    }

    class { 'alertmanager::irc':
        listen_host           => '0.0.0.0',
        listen_port           => 19190,
        irc_host              => $irc_host,
        irc_port              => $irc_port,
        irc_nickname          => $irc_nickname,
        irc_realname          => $irc_realname,
        irc_nickname_password => $irc_nickname_password,
        service_ensure        => $irc_ensure,
        dashboard_url         => "https://${vhost}",
    }

    # API (webhook)
    $hosts = join($partners + $active_host)
    ferm::service { 'alertmanager-irc':
        proto  => 'tcp',
        port   => 19190,
        srange => "@resolve((${hosts}))",
    }
}