Puppet Class: profile::vopsbot

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

Summary

profile to install vopsbot

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • active_host (String) (defaults to: lookup('profile::icinga::active_host'))

    fqdn of the active host

  • nickname (String) (defaults to: lookup('profile::vopsbot::nickname'))

    irc nick to use

  • password (String) (defaults to: lookup('profile::vopsbot::password'))

    irc password to use

  • vo_api_id (String) (defaults to: lookup('profile::vopsbot::vo_api_id'))

    VictorOps ID

  • vo_api_key (String) (defaults to: lookup('profile::vopsbot::vo_api_key'))

    VictorOps API key

  • channels (Array[String]) (defaults to: lookup('profile::vopsbot::irc_channels'))

    list of channels to join

  • vo_users (Hash[String, Vopsbot::User]) (defaults to: lookup('profile::vopsbot::vo_users'))

    list of authorised users

  • active_alert_host

    fqdn of the active alert host

  • alertmanager_partners (Array[Stdlib::Host]) (defaults to: lookup('profile::alertmanager::partners'))

    array of fqdn of the alertmanager partners

  • alertmanager_active_host (Stdlib::Host) (defaults to: lookup('profile::alertmanager::active_host'))


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

class profile::vopsbot(
    String                      $active_host              = lookup('profile::icinga::active_host'),
    String                      $nickname                 = lookup('profile::vopsbot::nickname'),
    String                      $password                 = lookup('profile::vopsbot::password'),
    String                      $vo_api_id                = lookup('profile::vopsbot::vo_api_id'),
    String                      $vo_api_key               = lookup('profile::vopsbot::vo_api_key'),
    Array[String]               $channels                 = lookup('profile::vopsbot::irc_channels'),
    Hash[String, Vopsbot::User] $vo_users                 = lookup('profile::vopsbot::vo_users'),
    Stdlib::Host                $alertmanager_active_host = lookup('profile::alertmanager::active_host'),
    Array[Stdlib::Host]         $alertmanager_partners    = lookup('profile::alertmanager::partners'),
) {
    $alertmanager_passive_hosts = $alertmanager_partners.filter |$partner| {
        $partner != $alertmanager_active_host
    }

    class { 'vopsbot':
        users                      => $vo_users,
        irc_server                 => 'irc.libera.chat',
        server_port                => 6697,
        nickname                   => $nickname,
        password                   => $password,
        irc_channels               => $channels,
        vo_api_id                  => $vo_api_id,
        vo_api_key                 => $vo_api_key,
        database_name              => 'vopsbot',
        run_service                => ($active_host == $facts['networking']['fqdn']),
        alertmanager_active_host   => $alertmanager_active_host,
        alertmanager_passive_hosts => $alertmanager_passive_hosts,
    }
}