Puppet Class: smokeping

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

Overview

Parameters:

  • active_server (Stdlib::Fqdn)


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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'modules/smokeping/manifests/init.pp', line 9

class smokeping(
    Stdlib::Fqdn $active_server,
) {

    require_package('smokeping', 'dnsutils')

    file { '/etc/smokeping/config.d':
        ensure  => directory,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        require => Package['smokeping'],
    }

    if $active_server == $::fqdn {
        $alerts = true
    } else {
        $alerts = false
    }

    ['Targets', 'General', 'pathnames', 'Alerts', 'Probes'].each |String $f| {
        file { "/etc/smokeping/config.d/${f}":
            ensure  => present,
            owner   => 'root',
            group   => 'root',
            mode    => '0444',
            content => template("smokeping/config.d/${f}.erb"),
            require => Package['smokeping'],
            notify  => Service['smokeping'],
        }
    }

    service { 'smokeping':
        ensure  => running,
        require => [
            Package['smokeping'],
            File['/etc/smokeping/config.d'],
        ],
    }
}