Puppet Class: statsd::backends

Defined in:
manifests/backends.pp

Overview

Class: statsd::backends



2
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
35
# File 'manifests/backends.pp', line 2

class statsd::backends {
  $backends = join($statsd::backends, ',')
  $node_base = "${statsd::node_module_dir}/statsd/node_modules"

  # Make sure $statsd::influxdb_host is set
  if $backends =~ /influxdb/ {
    exec { 'install-statsd-influxdb-backend':
      command => "${statsd::npm_bin} install --save ${statsd::influxdb_package_name}",
      cwd     => "${statsd::node_module_dir}/statsd",
      unless  => "/usr/bin/test -d ${node_base}/statsd-influxdb-backend",
      require => Package['statsd'],
    }
  }

  # Make sure $statsd::librato_email and $statsd::librato_token are set
  if $backends =~ /librato/ {
    exec { 'install-statsd-librato-backend':
      command => "${statsd::npm_bin} install --save statsd-librato-backend",
      cwd     => "${statsd::node_module_dir}/statsd",
      unless  => "/usr/bin/test -d ${node_base}/statsd-librato-backend",
      require => Package['statsd'],
    }
  }

  # Make sure $statsd::stackdriver_apiKey is set
  if $backends =~ /stackdriver/ {
    exec { 'install-statsd-stackdriver-backend':
      command => "${statsd::npm_bin} install --save stackdriver-statsd-backend",
      cwd     => "${statsd::node_module_dir}/statsd",
      unless  => "/usr/bin/test -d ${node_base}/stackdriver-statsd-backend",
      require => Package['statsd'],
    }
  }
}