Puppet Class: prometheus::varnishkafka_exporter

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

Overview

Parameters:

  • ensure (Any) (defaults to: 'present')
  • stats_default (Any) (defaults to: {})
  • config (Any) (defaults to: {})


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'modules/prometheus/manifests/varnishkafka_exporter.pp', line 1

class prometheus::varnishkafka_exporter(
  $ensure = 'present',
  $stats_default = {},
  $config = {}
) {
  # Merge safe default configuration with provided configuration
  $config_real = merge(
    {
      'stats_files'        => [],
      'required_entries'   => [],
      'num_entries_to_get' => 0,
      'stats'              => $stats_default
    },
    $config
  )

  package { 'prometheus-varnishkafka-exporter':
    ensure => 'installed'
  }

  file { '/etc/prometheus-varnishkafka-exporter.yaml':
    ensure  => 'present',
    mode    => '0444',
    content => to_yaml($config_real),
    require => [ Package['prometheus-varnishkafka-exporter'] ],
    notify  => [ Service['prometheus-varnishkafka-exporter'] ],
  }

  service { 'prometheus-varnishkafka-exporter':
    ensure => running,
    enable => true,
  }

  profile::auto_restarts::service { 'prometheus-varnishkafka-exporter': }
}