Puppet Class: profile::prometheus::pushgateway

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

Overview

Parameters:

  • pushgateway_host (Optional[Stdlib::Fqdn]) (defaults to: lookup('profile::prometheus::pushgateway_host'))
  • prometheus_nodes (Array) (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
23
24
# File 'modules/profile/manifests/prometheus/pushgateway.pp', line 1

class profile::prometheus::pushgateway (
    Optional[Stdlib::Fqdn] $pushgateway_host = lookup('profile::prometheus::pushgateway_host'),
    Array $prometheus_nodes = lookup('prometheus_nodes'),
) {
    $http_port = 9091

    if $pushgateway_host == $::fqdn {
        $ensure = present
    } else {
        $ensure = absent
    }

    class { 'prometheus::pushgateway':
        ensure      => $ensure,
        listen_port => $http_port,
    }

    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
    ferm::service { 'prometheus_pushgateway':
        proto  => 'tcp',
        port   => $http_port,
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }
}