Puppet Class: profile::prometheus::etherpad_exporter

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • listen_ip (Stdlib::IP::Address) (defaults to: lookup('profile::prometheus::etherpad_exporter::listen_ip', {'default_value' => '127.0.0.1'}))
  • listen_port (Stdlib::Port) (defaults to: lookup('profile::prometheus::etherpad_exporter::listen_port', {'default_value' => 9198}))
  • service_ensure (Stdlib::Ensure::Service) (defaults to: lookup('profile::prometheus::etherpad_exporter::service_ensure', {'default_value' => running}))


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
# File 'modules/profile/manifests/prometheus/etherpad_exporter.pp', line 2

class profile::prometheus::etherpad_exporter(
    Stdlib::IP::Address $listen_ip = lookup('profile::prometheus::etherpad_exporter::listen_ip', {'default_value' => '127.0.0.1'}),
    Stdlib::Port $listen_port = lookup('profile::prometheus::etherpad_exporter::listen_port', {'default_value' => 9198}),
    Stdlib::Ensure::Service $service_ensure = lookup('profile::prometheus::etherpad_exporter::service_ensure', {'default_value' => running}),
) {

    ensure_packages('prometheus-etherpad-exporter')

    service { 'prometheus-etherpad-exporter':
        ensure  => $service_ensure,
    }

    $ensure_override = $service_ensure ? {
        running => 'present',
        default => 'absent',
    }

    systemd::override { 'prometheus-etherpad-exporter-add-listen-address':
        ensure  => $ensure_override,
        unit    => 'prometheus-etherpad-exporter',
        content => "[Service]\nExecStart=\nExecStart=/usr/bin/prometheus-etherpad-exporter --listen ${listen_ip}:${listen_port}\n",
    }

    profile::auto_restarts::service { 'prometheus-etherpad-exporter':
        ensure  => $ensure_override,
    }
}