Puppet Class: bird::anycast_healthchecker

Defined in:
modules/bird/manifests/anycast_healthchecker.pp

Summary

Overview

SPDX-License-Identifier: Apache-2.0 Install and configure the base of anycast_healthchecker github.com/unixsurfer/anycast_healthchecker

  • Global configuration file

  • pid directory

  • Services checks directory

  • Log directory

  • systemd service

The actual services checks are configured with bird::anycast_healthchecker_check

Parameters:

  • bind_service (Optional[Array[String[1], 1]]) (defaults to: undef)

    the service for systemd to bind to

  • do_ipv6 (Boolean) (defaults to: false)

    configure ipv6

  • logging (Bird::Anycasthc_logging) (defaults to: {'level' => 'info', 'num_backups' => 8})

    The logging config hash



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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'modules/bird/manifests/anycast_healthchecker.pp', line 16

class bird::anycast_healthchecker(
    Optional[Array[String[1], 1]] $bind_service = undef,
    Boolean                       $do_ipv6      = false,
    Bird::Anycasthc_logging       $logging      = {'level' => 'info', 'num_backups' => 8},
){

    ensure_packages(['anycast-healthchecker'])

    file {
        default:
            ensure  => file,
            owner   => 'bird',
            group   => 'bird',
            mode    => '0664',
            require => Package['anycast-healthchecker'];
        '/etc/anycast-healthchecker.conf':
            content      => template('bird/anycast-healthchecker.conf.erb'),
            validate_cmd => '/usr/bin/anycast-healthchecker -f % --check';
        '/etc/bird/anycast-prefixes.conf':
            replace      => false;  # The content is managed by anycast-healthchecker
        '/etc/bird/anycast6-prefixes.conf':
            replace      => false;  # The content is managed by anycast-healthchecker
    }

    file {'/var/run/anycast-healthchecker/':
        ensure => directory,
        owner  => 'bird',
        group  => 'bird',
        mode   => '0775',
    }

    file {'/etc/anycast-healthchecker.d/':
        ensure  => directory,
        owner   => 'bird',
        group   => 'bird',
        mode    => '0775',
        purge   => true,
        recurse => true,
        notify  => Service['anycast-healthchecker'],
    }

    file {'/var/log/anycast-healthchecker/':
        ensure  => directory,
        owner   => 'bird',
        group   => 'bird',
        mode    => '0775',
        recurse => true,
        before  => Service['anycast-healthchecker'],
    }

    if $bind_service {
        $bind_service_with_ext = $bind_service.map |$srv| {
            $srv ? {
                Systemd::Service::Name => $srv,
                default                => "${srv}.service"
            }
        }
    }
    systemd::service { 'anycast-healthchecker':
        content        => template('bird/anycast-healthchecker.service.erb'),
        require        => File['/etc/anycast-healthchecker.conf',
        '/var/run/anycast-healthchecker/',
        '/var/log/anycast-healthchecker/',
        '/etc/anycast-healthchecker.d/',],
        restart        => true,
        service_params => {
            ensure  => 'running', # lint:ignore:ensure_first_param
            require => Service[$bind_service],
        },
    }
}