Puppet Class: alertmanager::irc

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

Overview

Parameters:

  • listen_host (Stdlib::Host) (defaults to: 'localhost')
  • listen_port (Stdlib::Port) (defaults to: 19190)
  • irc_host (Stdlib::Host) (defaults to: 'localhost')
  • irc_port (Stdlib::Port) (defaults to: 6697)
  • irc_nickname (String) (defaults to: $title)
  • irc_realname (String) (defaults to: $title)
  • dashboard_url (String) (defaults to: "https://alerts.${facts['domain']}")
  • irc_nickname_password (Optional[String]) (defaults to: undef)
  • service_ensure (Stdlib::Ensure::Service) (defaults to: running)


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

class alertmanager::irc (
    Stdlib::Host $listen_host = 'localhost',
    Stdlib::Port $listen_port = 19190,
    Stdlib::Host $irc_host = 'localhost',
    Stdlib::Port $irc_port = 6697,
    String $irc_nickname = $title,
    String $irc_realname = $title,
    String $dashboard_url = "https://alerts.${facts['domain']}",
    Optional[String] $irc_nickname_password = undef,
    Stdlib::Ensure::Service $service_ensure = running,
) {
    ensure_packages(['alertmanager-irc-relay'])

    $service_enable = $service_ensure ? {
        running => true,
        stopped => false,
    }

    service { 'alertmanager-irc-relay':
        ensure => $service_ensure,
        enable => $service_enable,
    }

    file { '/etc/alertmanager-irc-relay.yml':
        ensure    => present,
        owner     => 'alertmanager-irc-relay',
        group     => root,
        mode      => '0440',
        show_diff => false,
        content   => template('alertmanager/irc.yml.erb'),
        notify    => Service['alertmanager-irc-relay'],
    }
}