Puppet Class: datadog_agent::integrations::fluentd

Inherits:
datadog_agent::params
Defined in:
manifests/integrations/fluentd.pp

Overview

Class: datadog_agent::integrations::fluentd

This class will install the fluentd integration

Parameters:

$monitor_agent_url
    The url fluentd lists it's plugins on

Sample Usage:

class { 'datadog_agent::integrations::fluentd' :
  monitor_agent_url     => 'http://localhost:24220/api/plugins.json',
  plugin_ids => [
   'elasticsearch_out',
   'rsyslog_in',
 ],
}

Parameters:

  • monitor_agent_url (Any) (defaults to: 'http://localhost:24220/api/plugins.json')
  • plugin_ids (Optional[Array]) (defaults to: [])


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'manifests/integrations/fluentd.pp', line 20

class datadog_agent::integrations::fluentd(
  $monitor_agent_url = 'http://localhost:24220/api/plugins.json',
  Optional[Array] $plugin_ids = [],
) inherits datadog_agent::params {
  require ::datadog_agent

  $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/fluentd.yaml"
  if $::datadog_agent::_agent_major_version > 5 {
    $dst_dir = "${datadog_agent::params::conf_dir}/fluentd.d"
    file { $legacy_dst:
      ensure => 'absent'
    }

    file { $dst_dir:
      ensure  => directory,
      owner   => $datadog_agent::params::dd_user,
      group   => $datadog_agent::params::dd_group,
      mode    => $datadog_agent::params::permissions_directory,
      require => Package[$datadog_agent::params::package_name],
      notify  => Service[$datadog_agent::params::service_name]
    }
    $dst = "${dst_dir}/conf.yaml"
  } else {
    $dst = $legacy_dst
  }

  file { $dst:
    ensure  => file,
    owner   => $datadog_agent::params::dd_user,
    group   => $datadog_agent::params::dd_group,
    mode    => $datadog_agent::params::permissions_protected_file,
    content => template('datadog_agent/agent-conf.d/fluentd.yaml.erb'),
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name],
  }
}