Puppet Class: serverdensity_agent::config_file

Defined in:
manifests/config_file.pp

Overview

Parameters:

  • api_token (Any)
  • sd_account (Any)
  • server_group (Any)
  • use_fqdn (Any)
  • provided_agent_key (Any) (defaults to: $::sd_agent_key)
  • proxy_host (Any) (defaults to: undef)
  • proxy_port (Any) (defaults to: undef)
  • proxy_user (Any) (defaults to: undef)
  • proxy_password (Any) (defaults to: undef)
  • proxy_forbid_method_switch (Any) (defaults to: undef)
  • server_name (Any) (defaults to: undef)
  • plugin_directory (Any) (defaults to: '')
  • log_level (Any) (defaults to: undef)
  • collector_log_file (Any) (defaults to: undef)
  • forwarder_log_file (Any) (defaults to: undef)
  • log_to_syslog (Any) (defaults to: undef)
  • syslog_host (Any) (defaults to: undef)
  • syslog_port (Any) (defaults to: undef)
  • use_sdstatsd (Any) (defaults to: false)
  • statsd_fw_host (Any) (defaults to: undef)
  • statsd_fw_port (Any) (defaults to: undef)


14
15
16
17
18
19
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'manifests/config_file.pp', line 14

class serverdensity_agent::config_file (
  $api_token,
  $sd_account,
  $server_group,
  $use_fqdn,
  $provided_agent_key = $::sd_agent_key,
  $proxy_host = undef,
  $proxy_port = undef,
  $proxy_user = undef,
  $proxy_password = undef,
  $proxy_forbid_method_switch = undef,
  $server_name = undef,
  $plugin_directory = '',
  $log_level = undef,
  $collector_log_file = undef,
  $forwarder_log_file = undef,
  $log_to_syslog = undef,
  $syslog_host = undef,
  $syslog_port = undef,
  $use_sdstatsd = false,
  $statsd_fw_host = undef,
  $statsd_fw_port = undef,
  ) {
  $agent_key = agent_key(
    $api_token,
    $provided_agent_key,
    $server_name,
    $server_group,
    $use_fqdn )

  file { '/etc/sd-agent/conf.d':
    ensure => 'directory',
    mode   => '0755',
    notify => Class['serverdensity_agent::service'],
  }

  file { '/etc/sd-agent/config.cfg':
    ensure  => 'file',
    content => template('serverdensity_agent/config.cfg.erb'),
    mode    => '0644',
    notify  => Class['serverdensity_agent::service'],
  }

  # Legacy configurations for V1 plugins
  file { '/etc/sd-agent/plugins.d':
    ensure => 'directory',
    mode   => '0755',
    notify => Class['serverdensity_agent::service'],
  }

  # Write the agent key to a file so no api lookups are required
  file { '/var/run/sd-agent-key':
    ensure  => 'present',
    replace => 'no',
    content => $agent_key,
    mode    => '0644',
  }
}