Puppet Class: profile::bgpalerter

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

Summary

profile to configure bgpalerter

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • asn (Integer[1]) (defaults to: lookup('profile::bgpalerter::asn'))

    The ASN to monitor

  • group (String[1]) (defaults to: lookup('profile::bgpalerter::group'))

    notification group

  • user (String[1]) (defaults to: lookup('profile::bgpalerter::user'))

    used to run service

  • upstreams (Array[Integer[1]]) (defaults to: lookup('profile::bgpalerter::upstreams'))

    list of valid upstreams

  • downstreams (Array[Integer[1]]) (defaults to: lookup('profile::bgpalerter::downstreams'))

    list of valid downstreams

  • reports (Array[Bgpalerter::Report]) (defaults to: lookup('profile::bgpalerter::reports'))

    a list of bgpalert reports to configure

  • monitors (Array[Bgpalerter::Monitor]) (defaults to: lookup('profile::bgpalerter::monitors'))

    a list of bgpalert monitors to configure

  • http_proxy (Optional[Stdlib::HTTPUrl]) (defaults to: lookup('profile::bgpalerter::http_proxy'))

    optional http proxy server to use

  • rpki (Bgpalerter::Rpki) (defaults to: lookup('profile::bgpalerter::rpki'))


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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'modules/profile/manifests/bgpalerter.pp', line 11

class profile::bgpalerter(
    Integer[1]                 $asn         = lookup('profile::bgpalerter::asn'),
    String[1]                  $user        = lookup('profile::bgpalerter::user'),
    String[1]                  $group       = lookup('profile::bgpalerter::group'),
    Bgpalerter::Rpki           $rpki        = lookup('profile::bgpalerter::rpki'),
    Array[Integer[1]]          $upstreams   = lookup('profile::bgpalerter::upstreams'),
    Array[Integer[1]]          $downstreams = lookup('profile::bgpalerter::downstreams'),
    Array[Bgpalerter::Report]  $reports     = lookup('profile::bgpalerter::reports'),
    Array[Bgpalerter::Monitor] $monitors    = lookup('profile::bgpalerter::monitors'),
    Optional[Stdlib::HTTPUrl]  $http_proxy  = lookup('profile::bgpalerter::http_proxy'),
) {
    include network::constants
    # Curently we use the same config for all prefixes
    $prefix_config = {
        'description'         => 'No description provided',
        'asn'                 => [$asn],
        'ignoreMorespecifics' => false,
        'ignore'              => false,
        'group'               => $group,
    }
    $all_external_networks = concat($network::constants::external_networks,
                                    $network::constants::customers_networks)
    $prefixes = Hash($all_external_networks.map |$net| {
        [$net, $prefix_config]
    })
    $prefixes_options = {
        'monitorASns' => {
            String($asn) => {
                'group'       => $group,
                'upstreams'   => $upstreams,
                'downstreams' => $downstreams,
            },
        },
    }
    systemd::sysuser { $user:
        id          => '917:917',         # https://wikitech.wikimedia.org/wiki/UID
        description => 'Bgpalerter User',
        before      => Class['bgpalerter'],
    }
    class { 'bgpalerter':
        rpki             => $rpki,
        reports          => $reports,
        monitors         => $monitors,
        httpProxy        => $http_proxy,
        prefixes         => $prefixes,
        prefixes_options => $prefixes_options,
        manage_user      => false,
        user             => $user,
    }
}