Puppet Class: gobgpd

Defined in:
modules/gobgpd/manifests/init.pp

Overview

Parameters:

  • config_content (String) (defaults to: undef)


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
# File 'modules/gobgpd/manifests/init.pp', line 13

class gobgpd(
    String $config_content = undef,
) {
    ensure_packages(['gobgpd'])

    if $config_content {
        $process_ensure  = running
        $file_ensure = present
        $enabled = true
    } else {
        $process_ensure  = stopped
        $file_ensure = absent
        $enabled = false
    }
    file{ '/etc/gobgpd.conf':
        ensure  => $file_ensure,
        content => $config_content,
        # Don't automatically restart the daemon as the prefixes are in memory
        #notify  => Service['gobgpd'],
        require => Package['gobgpd'],
    }
    service {'gobgpd':
        ensure => $process_ensure,
        enable => $enabled,
    }

    # Routes are kept in memory, so a restart need to be properly planned between the two instances
    # base::service_auto_restart { 'gobgpd': }

}