Puppet Class: prometheus::client::node

Defined in:
manifests/client/node.pp

Summary

Configure node exporter

Overview



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
# File 'manifests/client/node.pp', line 3

class prometheus::client::node {
  include prometheus

  package { 'prometheus-node-exporter': }

  -> file { '/etc/conf.d/prometheus-node-exporter':
    ensure  => file,
    content => 'NODE_EXPORTER_ARGS="--collector.textfile.directory=/var/lib/node-exporter"',
    notify  => Service['prometheus-node-exporter'],
  }

  -> file { '/var/lib/node-exporter':
    ensure => directory,
  }

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

  Configvault_Write { 'prometheus/node':
    source => '/etc/identifier',
    public => true,
  }

  firewall { '100 allow prometheus node metrics':
    source => $prometheus::server_ip,
    dport  => 9100,
    proto  => 'tcp',
    action => 'accept',
  }
}