Defined Type: elasticsearch::python

Defined in:
manifests/python.pp

Overview

There are many python bindings for elasticsearch. This provides all the ones we know about www.elasticsearch.org/guide/clients/

Examples:

installing the pyes python Elasticsearch library

elasticsearch::python { 'pyes':; }

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
57
58
59
# File 'manifests/python.pp', line 19

define elasticsearch::python (
  $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 {
    'pyes': {
      $provider = 'pip'
    }
    'rawes': {
      $provider = 'pip'
    }
    'pyelasticsearch': {
      $provider = 'pip'
    }
    'ESClient': {
      $provider = 'pip'
    }
    'elasticutils': {
      $provider = 'pip'
    }
    'elasticsearch': {
      $provider = 'pip'
    }
    default: {
      fail("unknown python binding package '${name}'")
    }
  }

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

}