Defined Type: netops::prometheus::dns

Defined in:
modules/netops/manifests/prometheus/dns.pp

Overview

$targets is the list of nameservers to probe $modules is the list of dns probes modules to use $targets_file is the path to write the result to $extra_labels is an hash to labels to attach to each target,

Parameters:

  • targets (Array[Stdlib::Fqdn])
  • modules (Array[String])
  • targets_file (String)
  • extra_labels (Hash[String, String]) (defaults to: {})


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'modules/netops/manifests/prometheus/dns.pp', line 9

define netops::prometheus::dns (
  Array[Stdlib::Fqdn] $targets,
  Array[String] $modules,
  String $targets_file,
  Hash[String, String] $extra_labels = {},
) {
  $targets_list = $targets.map |$t| { "${t}:53" }

  $out = $modules.map |$module| {
    {
      targets => $targets_list,
      labels => {
        module => $module,
      } + $extra_labels
    }
  }

  file { $targets_file:
    content => to_yaml(flatten($out)),
  }
}