Puppet Class: heartbeat::config

Defined in:
manifests/config.pp

Summary

It configures the heartbeat shipper

Overview

heartbeat::config



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
36
# File 'manifests/config.pp', line 5

class heartbeat::config {
  $heartbeat_bin = '/usr/share/heartbeat/bin/heartbeat'

  $validate_cmd = $heartbeat::disable_configtest ? {
    true => undef,
    default => "${heartbeat_bin} test config -c %",
  }

  $heartbeat_config = delete_undef_values({
    'name'                      => $heartbeat::beat_name ,
    'fields_under_root'         => $heartbeat::fields_under_root,
    'fields'                    => $heartbeat::fields,
    'xpack'                     => $heartbeat::xpack,
    'tags'                      => $heartbeat::tags,
    'queue'                     => $heartbeat::queue,
    'logging'                   => $heartbeat::logging,
    'output'                    => $heartbeat::outputs,
    'processors'                => $heartbeat::processors,
    'heartbeat'                 => {
      'monitors'                 => $heartbeat::monitors,
    },
  })

  file { '/etc/heartbeat/heartbeat.yml':
    ensure       => $heartbeat::ensure,
    owner        => 'root',
    group        => 'root',
    mode         => $heartbeat::config_file_mode,
    content      => inline_template('<%= @heartbeat_config.to_yaml()  %>'),
    validate_cmd => $validate_cmd,
  }
}