Defined Type: profile::prometheus::redis_exporter

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

Overview

Define profile::prometheus::redis_exporter

Install an instance of prometheus-redis-exporter.

title

The port redis server is listening on

password

The password to be used to access redis.

hostname

The hostname for redis-exporter to listen on.

port

The port for redis-exporter to listen on.

prometheus_nodes

A list of hosts to allow access to redis-exporter

Parameters:

  • password (Any)
  • prometheus_nodes (Any)
  • hostname (Any) (defaults to: $::hostname)
  • port (Any) (defaults to: +)
  • arguments (Any) (defaults to: '')


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'modules/profile/manifests/prometheus/redis_exporter.pp', line 20

define profile::prometheus::redis_exporter (
    $password,
    $prometheus_nodes,
    $hostname = $::hostname,
    $port = $title + 10000,
    $arguments = '',
) {
    ::prometheus::redis_exporter { $title:
        hostname  => $hostname,
        port      => $port,
        password  => $password,
        arguments => $arguments,
    }

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