Puppet Class: stackdriver::plugin::elasticsearch

Inherited by:
stackdriver::plugin::elasticsearch::config
stackdriver::plugin::elasticsearch::install
Defined in:
manifests/plugin/elasticsearch.pp

Overview

vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 foldmethod=marker

Class: stackdriver::plugin::elasticsearch

Enable Elasticsearch Agent Plugin for Stackdriver Agent

Stackdriver’s Support Site

Parameters


pkg
  • Default - Based on $::osfamily

  • List of package(s) to install

config
  • Default - /opt/stackdriver/collectd/etc/collectd.d/elasticsearch.conf

  • Plugin configuration file

host
  • Default - localhost

  • Target host

port
  • Default - 6379

  • Target port

Usage


Puppet Code

Enable Elasticsearch plugin via Puppet CODE:

include '::stackdriver::plugin::elasticsearch'

Hiera

Enable Elasticsearch plugin via Hiera:

stackdriver::plugins:
 - 'elasticsearch'

Parameters:

  • pkg (Any) (defaults to: $::osfamily ? { /(?i:Debian)/ => 'libyajl1', /(?i:RedHat)/ => 'yajl', default => undef)
  • config (Any) (defaults to: '/opt/stackdriver/collectd/etc/collectd.d/elasticsearch.conf')
  • host (Any) (defaults to: 'localhost')
  • port (Any) (defaults to: 9200)


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
# File 'manifests/plugin/elasticsearch.pp', line 44

class stackdriver::plugin::elasticsearch(

  $pkg = $::osfamily ? {
    /(?i:Debian)/   => 'libyajl1',
    /(?i:RedHat)/   => 'yajl',
    default         => undef,
  },

  $config = '/opt/stackdriver/collectd/etc/collectd.d/elasticsearch.conf',

  $host     = 'localhost',
  $port     = 9200,

) {

  Class['stackdriver'] -> Class[$name]

  if $pkg { validate_string ( $pkg ) }
  validate_string ( $config )


  contain "${name}::install"

  class { "::${name}::config": require => Class["::${name}::install"] }
  contain "${name}::config"

}