Puppet Class: prometheus::node_cloudvirt_libvirt_stats

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

Overview

Parameters:

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


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'modules/prometheus/manifests/node_cloudvirt_libvirt_stats.pp', line 1

class prometheus::node_cloudvirt_libvirt_stats(
  Wmflib::Ensure $ensure  = 'present',
  Stdlib::Unixpath $outfile = '/var/lib/prometheus/node.d/node_cloudvirt_libvirt_stats.prom',
) {
    ensure_packages(['python3-click'])

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

    systemd::timer::job { 'prometheus-node-cloudvirt-libvirt-stats':
        ensure         => $ensure,
        user           => 'root',
        description    => 'Generate cloudvirt specific libvirt statistics.',
        command        => $script,
        stdout         => "file:${outfile}",
        exec_start_pre => "/usr/bin/rm -f ${outfile}",
        interval       => {
            'start'    => 'OnCalendar',
            'interval' => 'minutely',
        },
        require        => [File[$script], Class['prometheus::node_exporter'],]
    }
}