Puppet Class: prometheus::postgres_exporter

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

Overview

Class prometheus::postgres_exporter

Install/configure postgresql prometheus exporter

Parameters:

  • prometheus_user (Any) (defaults to: 'prometheus')
  • prometheus_db (Any) (defaults to: 'postgres')
  • ensure (Any) (defaults to: 'present')


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'modules/prometheus/manifests/postgres_exporter.pp', line 4

class prometheus::postgres_exporter(
    $prometheus_user = 'prometheus',
    $prometheus_db = 'postgres',
    $ensure='present'
) {
    package { 'prometheus-postgres-exporter':
        ensure => $ensure,
    }

    file { '/etc/default/prometheus-postgres-exporter':
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('prometheus/prometheus-postgres-exporter.default.erb'),
    }
    service { 'prometheus-postgres-exporter':
        ensure => running,
        enable => true,
    }

    base::service_auto_restart { 'prometheus-postgres-exporter': }
}