Puppet Class: profile::prometheus::cadvisor_exporter

Defined in:
modules/profile/manifests/prometheus/cadvisor_exporter.pp

Overview

Parameters:

  • port (Stdlib::Port) (defaults to: lookup('profile::prometheus::cadvisor_exporter::port'))
  • prometheus_nodes (Array[Stdlib::Host]) (defaults to: lookup('prometheus_nodes'))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/profile/manifests/prometheus/cadvisor_exporter.pp', line 1

class profile::prometheus::cadvisor_exporter (
    Stdlib::Port        $port             = lookup('profile::prometheus::cadvisor_exporter::port'),
    Array[Stdlib::Host] $prometheus_nodes = lookup('prometheus_nodes'),
){

    # We only support buster and above cause we have no incentive to support
    # stretch and below
    if debian::codename::ge('buster'){
        class { 'prometheus::cadvisor_exporter':
          port   => $port,
          ensure => 'present',
        }

        $prometheus_ferm_nodes = join($prometheus_nodes, ' ')
        $ferm_srange = "(@resolve((${prometheus_ferm_nodes})) @resolve((${prometheus_ferm_nodes}), AAAA))"
        ferm::service { 'prometheus-cadvisor-exporter':
          proto  => 'tcp',
          port   => $port,
          srange => $ferm_srange,
        }
    }
}