Defined Type: prometheus::pdu_config

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

Overview

Parameters:

  • dest (String)
  • model (String) (defaults to: 'sentry3')
  • resource (String) (defaults to: 'Facilities::Monitor_pdu_3phase')
  • labels (Hash) (defaults to: {})


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'modules/prometheus/manifests/pdu_config.pp', line 10

define prometheus::pdu_config(
    String $dest,
    String $model    = 'sentry3',
    String $resource = 'Facilities::Monitor_pdu_3phase',
    Hash   $labels   = {},
) {

    $pql = @("PQL")
    resources[parameters, title] {
        type = "${resource}" and
        parameters.model = "${model}" and parameters.site = "${::site}"
        order by parameters
    }
    | PQL
    $pdu_resources = wmflib::puppetdb_query($pql)

    file { $dest:
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('prometheus/pdu_config.erb'),
    }
}