Puppet Class: prometheus::node_debian_version

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

Overview

Class: prometheus::node_debian_version

Periodically export the version of Debian installed.

Intended to run on all hosts.

Parameters:

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


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

class prometheus::node_debian_version (
    Wmflib::Ensure $ensure = 'present',
    Stdlib::Unixpath $outfile = '/var/lib/prometheus/node.d/debian_version.prom',
) {
    $exec = '/usr/local/bin/prometheus-debian-version'
    file { $exec:
        ensure => $ensure,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-debian-version.sh',
    }

    systemd::timer::job { 'prometheus-debian-version-textfile':
        ensure          => $ensure,
        description     => 'Update Debian version stat exported by node_exporter',
        command         => "${exec} ${outfile}",
        user            => 'root',
        logging_enabled => false,
        require         => [File[$exec]],
        interval        => {
            # We don't care about when this runs, as long as it runs every few minutes.
            # We also explicitly *don't* want to synchronize its execution across hosts,
            # as OnCalendar would do, and this should have some natural splay.
            'start'    => 'OnUnitInactiveSec',
            'interval' => '300s',
        },
    }
}