Defined Type: elasticsearch::ruby

Defined in:
manifests/ruby.pp

Overview

There are many ruby bindings for elasticsearch; this provides all the ones we know about: www.elasticsearch.org/guide/clients/

Examples:

install the elasticsearch ruby library

elasticsearch::ruby { 'elasticsearch': }

Parameters:

  • ensure (String) (defaults to: 'present')

    Controls if the managed resources shall be ‘present` or `absent`. If set to `absent`, the managed software packages will be uninstalled, and any traces of the packages will be purged as well as possible, possibly including existing configuration files. System modifications (if any) will be reverted as well as possible (e.g. removal of created users, services, changed log settings, and so on). This is a destructive parameter and should be used with care.

Author:

  • Richard Pijnenburg <richard.pijnenburg@elasticsearch.com>

  • Tyler Langlois <tyler.langlois@elastic.co>



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
# File 'manifests/ruby.pp', line 19

define elasticsearch::ruby (
  $ensure = 'present'
) {

  if ! ($ensure in [ 'present', 'absent' ]) {
    fail("\"${ensure}\" is not a valid ensure parameter value")
  }

  # make sure the package name is valid and setup the provider as
  # necessary
  case $name {
    'tire': {
      $provider = 'gem'
    }
    'stretcher': {
      $provider = 'gem'
    }
    'elastic_searchable': {
      $provider = 'gem'
    }
    'elasticsearch': {
      $provider = 'gem'
    }
    'flex': {
      $provider = 'gem'
    }
    default: {
      fail("unknown ruby client package '${name}'")
    }
  }

  package { "ruby_${name}":
    ensure   => $ensure,
    name     => $name,
    provider => $provider,
  }

}