elasticsearch
Version information
This version is compatible with:
- Puppet Enterprise >= 3.1.3
- Puppet >=2.7.20 <4.0.0
- , , , , , ,
This module has been deprecated by its author since Jun 7th 2017.
The author has suggested elastic-elasticsearch as its replacement.
Start using this module
Documentation
puppet-elasticsearch
A Puppet module for managing elasticsearch nodes.
Requirements
- Puppet 2.7.x or better.
- The stdlib Puppet library.
Optional:
- The apt Puppet library when using repo management on Debian/Ubuntu.
Usage examples
Installation, make sure service is running and will be started at boot time:
class { 'elasticsearch': }
Install a certain version:
class { 'elasticsearch':
version => '0.90.3'
}
This assumes an elasticsearch package is already available to your distribution's package manager. To install it in a different way:
To download from http/https/ftp source:
class { 'elasticsearch':
package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb'
}
To download from a puppet:// source:
class { 'elasticsearch':
package_url => 'puppet:///path/to/elasticsearch-0.90.7.deb'
}
Or use a local file source:
class { 'elasticsearch':
package_url => 'file:/path/to/elasticsearch-0.90.7.deb'
}
Automatic upgrade of the software ( default set to false ):
class { 'elasticsearch':
autoupgrade => true
}
Removal/decommissioning:
class { 'elasticsearch':
ensure => 'absent'
}
Install everything but disable service(s) afterwards:
class { 'elasticsearch':
status => 'disabled'
}
Disable automated restart of Elasticsearch on config file change:
class { 'elasticsearch':
restart_on_change => false
}
For the config variable a hash needs to be passed:
class { 'elasticsearch':
config => {
'node' => {
'name' => 'elasticsearch001'
},
'index' => {
'number_of_replicas' => '0',
'number_of_shards' => '5'
},
'network' => {
'host' => $::ipaddress
}
}
}
Short write up of the config hash is also possible.
Instead of writing the full hash representation:
class { 'elasticsearch':
config => {
'cluster' => {
'name' => 'ClusterName',
'routing' => {
'allocation' => {
'awareness' => {
'attributes' => 'rack'
}
}
}
}
}
}
You can write the dotted key naming:
class { 'elasticsearch':
config => {
'cluster' => {
'name' => 'ClusterName',
'routing.allocation.awareness.attributes' => 'rack'
}
}
}
Manage templates
Add a new template
This will install and/or replace the template in Elasticsearch
elasticsearch::template { 'templatename':
file => 'puppet:///path/to/template.json'
}
Delete a template
elasticsearch::template { 'templatename':
ensure => 'absent'
}
Host
Default it uses localhost:9200 as host. you can change this with the 'host' and 'port' variables
elasticsearch::template { 'templatename':
host => $::ipaddress,
port => 9200
}
Bindings / clients
Install a variety of clients/bindings:
Python
elasticsearch::python { 'rawes': }
Ruby
elasticsearch::ruby { 'elasticsearch': }
Plugins
Install a variety of plugins:
From official repository:
elasticsearch::plugin{'mobz/elasticsearch-head':
module_dir => 'head'
}
From custom url:
elasticsearch::plugin{ 'elasticsearch-jetty':
module_dir => 'jetty',
url => 'https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.0.zip'
}
Java Install
Most sites will manage Java separately; however, this module can attempt to install Java as well.
class { 'elasticsearch':
java_install => true
}
Specify a particular Java package (version) to be installed:
class { 'elasticsearch':
java_install => true,
java_package => 'packagename'
}
Repository management
Most sites will manage repositories separately; however, this module can manage the repository for you.
class { 'elasticsearch':
manage_repo => true,
repo_version => '1.0',
}
Note: When using this on Debian/Ubuntu, you will need to add the Puppetlabs/apt module to your modules.
Service Management
Currently only the basic SysV-style init service provider is supported, but other systems could be implemented as necessary (pull requests welcome).
init
Defaults File
The defaults file (/etc/defaults/elasticsearch
or /etc/sysconfig/elasticsearch
) for the Logstash service can be populated as necessary. This can either be a static file resource or a simple key value-style hash object, the latter being particularly well-suited to pulling out of a data source such as Hiera.
file source
class { 'elasticsearch':
init_defaults_file => 'puppet:///path/to/defaults'
}
hash representation
$config_hash = {
'ES_USER' => 'elasticsearch',
'ES_GROUP' => 'elasticsearch',
}
class { 'elasticsearch':
init_defaults => $config_hash
}
Support
Need help? Join us in #elasticsearch on Freenode IRC or subscribe to the elasticsearch@googlegroups.com mailing list.
0.3.0 ( April 2, 2014 ) Fix minor issue with yumrepo in repo class ( PR #92 ) Implement OpenSuse support Implement Junit reporting for tests Adding more system tests and convert to Docker images Use Augeas for managing the defaults file Add retry to package download exec Add management to manage the logging.yml file Improve inline documentation Improve support for Debian 6 Improve augeas for values with spaces Run plugin install as ES user ( PR #108 ) Fix rights for the plugin directory Pin Rake for Ruby 1.8.7 Adding new metadata for Forge. Increase time for retry to insert the template
0.2.4 ( Feb 21, 2014 ) Set puppetlabs-stdlib dependency version from 3.0.0 to 3.2.0 to be inline with other modules Let puppet run fail when template insert fails Documentation improvements ( PR #77, #78, #83 ) Added beaker system tests Fixed template define after failing system tests Some fixes so variables are more inline with intended structure
0.2.3 ( Feb 06, 2014 ) Add repository management feature Improve testing coverage and implement basic resource coverage reporting Add puppet 3.4.x testing Fix dependency in template define ( PR #72 ) For apt repo change from key server to key file
0.2.2 ( Jan 23, 2014 ) Ensure exec names are unique. This caused issues when using our logstash module Add spec tests for plugin define
0.2.1 ( Jan 22, 2014 ) Simplify the management of the defaults file ( PR #64 ) Doc improvements for the plugin define ( PR #66 ) Allow creation of data directory ( PR #68 ) Fail early when package version and package_url are defined
0.2.0 ( Nov 19, 2013 ) Large rewrite of the entire module described below Make the core more dynamic for different service providers and multi instance capable Add better testing and devided into different files Fix template function. Replace of template is now only done when the file is changed Add different ways to install the package except from the repository ( puppet/http/https/ftp/file ) Update java class to install openjdk 1.7 Add tests for python function Update config file template to fix scoping issue ( from PR #57 ) Add validation of templates Small changes for preperation for system tests Update readme for new functionality Added more test scenario's Added puppet parser validate task for added checking Ensure we don't add stuff when removing the module Update python client define Add ruby client define Add tests for ruby clients and update python client tests
0.1.3 ( Sep 06, 2013 ) Exec path settings has been updated to fix warnings ( PR #37, #47 ) Adding define to install python bindings ( PR #43 ) Scope deprecation fixes ( PR #41 ) feature to install plugins ( PR #40 )
0.1.2 ( Jun 21, 2013 ) Update rake file to ignore the param inherit Added missing documentation to the template define Fix for template define to allow multiple templates ( PR #36 by Bruce Morrison )
0.1.1 ( Jun 14, 2013 ) Add Oracle Linux to the OS list ( PR #25 by Stas Alekseev ) Respect the restart_on_change on the defaults ( PR #29 by Simon Effenberg ) Make sure the config can be empty as advertised in the readme Remove dependency cycle when the defaults file is updated ( PR #31 by Bruce Morrison ) Enable retry on the template insert in case ES isn't started yet ( PR #32 by Bruce Morrison ) Update templates to avoid deprecation notice with Puppet 3.2.x Update template define to avoid auto insert issue with ES Update spec tests to reflect changes to template define
0.1.0 ( May 09, 2013 ) Populate .gitignore ( PR #19 by Igor Galić ) Add ability to install initfile ( PR #20 by Justin Lambert ) Add ability to manage default file* service parameters ( PR #21 by Mathieu Bornoz ) Providing complete containment of the module ( PR #24 by Brian Lalor ) Add ability to specify package version ( PR #25 by Justin Lambert ) Adding license file
0.0.7 ( Mar 23, 2013 ) Ensure config directory is created and managed ( PR #13 by Martin Seener ) Dont backup package if it changes Create explicit dependency on template directory ( PR #16 by Igor Galić ) Make the config directory variable ( PR #17 by Igor Galić and PR #18 by Vincent Janelle ) Fixing template define
0.0.6 ( Mar 05, 2013 ) Fixing issue with configuration not printing out arrays New feature to write the config hash shorter Updated readme to reflect the new feature Adding spec tests for config file generation
0.0.5 ( Mar 03, 2013 ) Option to disable restart on config file change ( PR #10 by Chris Boulton )
0.0.4 ( Mar 02, 2013 ) Fixed a major issue with the config template ( Issue #9 )
0.0.3 ( Mar 02, 2013 ) Adding spec tests Fixed init issue on Ubuntu ( Issue #6 by Marcus Furlong ) Fixed config template problem ( Issue #8 by surfchris ) New feature to manage templates
0.0.2 ( Feb 16, 2013 ) Feature to supply a package instead of being dependent on the repository Feature to install java in case one doesn't manage it externally Adding RedHat and Amazon as Operating systems fixed a typo - its a shard not a shared :) ( PR #5 by Martin Seener )
0.0.1 ( Jan 13, 2013 ) Initial release of the module
Dependencies
- puppetlabs/stdlib (>= 3.2.0)
Copyright (c) 2012-2014 Elasticsearch <http://www.elasticsearch.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.