Defined Type: telegraf::processor

Defined in:
manifests/processor.pp

Summary

A Puppet wrapper for discrete Telegraf processor files

Overview

Parameters:

  • options (Optional[Array]) (defaults to: undef)

    Plugin options for use in the processor template

  • plugin_type (String) (defaults to: $name)

    Define the telegraf plugin type to use

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    Set if the ensure params of the config file. If telegraf::ensure is absent the value is automatically absent



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'manifests/processor.pp', line 9

define telegraf::processor (
  String          $plugin_type      = $name,
  Optional[Array] $options          = undef,
  Enum['present', 'absent'] $ensure = 'present',
) {
  include telegraf

  $_ensure = $telegraf::ensure ? {
    'absent' => 'absent',
    default  => $ensure,
  }

  file { "${telegraf::config_folder}/${name}.conf":
    ensure  => $_ensure,
    content => stdlib::to_toml({ 'processors'=> { $plugin_type=> $options } }),
    require => Class['telegraf::config'],
    notify  => Class['telegraf::service'],
  }
}