Puppet Class: prometheus::node_gdnsd

Defined in:
modules/prometheus/manifests/node_gdnsd.pp

Overview

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • outfile (Stdlib::Unixpath) (defaults to: '/var/lib/prometheus/node.d/gdnsd.prom')


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
# File 'modules/prometheus/manifests/node_gdnsd.pp', line 11

class prometheus::node_gdnsd (
    Wmflib::Ensure   $ensure  = 'present',
    Stdlib::Unixpath $outfile = '/var/lib/prometheus/node.d/gdnsd.prom',
) {
    if $outfile !~ '\.prom$' {
        fail("outfile (${outfile}): Must have a .prom extension")
    }

    ensure_packages( [
        'python3-prometheus-client',
        'python3-requests',
    ] )

    file { '/usr/local/bin/prometheus-gdnsd-stats':
        ensure => file,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-gdnsd-stats.py',
    }

    # Collect every minute
    systemd::timer::job { 'prometheus_gdnsd_stats':
        ensure      => $ensure,
        description => 'Regular job to collect gdnsd stats',
        user        => 'root',
        command     => "/usr/local/bin/prometheus-gdnsd-stats --outfile ${outfile}",
        interval    => {'start' => 'OnCalendar', 'interval' => 'minutely'},
    }
}