Version information
This version is compatible with:
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'jlambert121-curator', '2.3.1'
Learn more about managing modules with a PuppetfileDocumentation
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with curator
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Changelog/Contributors
Overview
A puppet module for installing and configuring elastic-curator.
Module Description
Curator is used to manage and clean up time-series elasticsearch indexes, this module manages curator.
NOTE: If you are using curator < 3.0.0 use a previous version of this module.
Setup
What curator affects
- curator package
- curator cron jobs
Beginning with curator
Installation of the curator module:
puppet module install jlambert121-curator
Usage
Generic curator install via pip (requires pip is installed)
class { 'curator': }
Install via yum
class { 'curator':
package_name => 'python-elasticsearch-curator',
provider => 'yum'
}
Close indexes over 2 days old
curator::job { 'logstash_close':
command => 'close',
older_than => 2,
cron_hour => 7,
cron_minute => 20,
}
Delete marvel indexes older than a week
curator::job { 'marvel_delete':
command => 'delete',
prefix => '.marvel-',
older_than => 7,
cron_hour => 7,
cron_minute => 02
}
Use hiera for your jobs
curator::jobs:
logstash_close:
command: close
older_than: 2
cron_hour: 2
cron_minute: 20
marvel_delete:
command: delete
prefix: '.marvel'
older_than: 7
cron_hour: 7
cron_minute: 20
Currently this package supports installing curator via pip or your local package manager. RPM packages can easly be created by running:
fpm -s python -t rpm urllib3
fpm -s python -t rpm elasticsearch
fpm -s python -t rpm click
fpm -s python -t rpm elasticsearch-curator
Reference
Public methods
Class: curator
Main class for installing Atlassian CLI by Bob Swift.
#####ensure
String. Version to install
Default: latest
#####package_name
String. Name of the package to install
Default: elasticsearch-curator
#####provider
String. Package provider used to install $package_name
Default: pip
#####bin_file
String. Location of the curator binary
Default: /bin/curator
#####host
String. ES host. Inherited/used by curator::job
Default: localhost
#####port
Integer. Port ES is listening on. Inherited/used by curator::job
Default: 9200
#####logfile
String. Logfile to write the output log to. Inherited/used by curator::job
Defalut: /var/log/curator.log
#####log_level
String. Logging level. Inherited/used by curator::job
Default: INFO
#####logformat
String. Log format to write logs in. Inherited/used by curator::job
Default: default
Valid values: default, logstash
Define: curator::job
Manages cron entires for curator jobs
#####command
String. Curator command to run.
Valid options: alias, allocation, close, delete, open, optimize, replicas, or snapshot
#####bin_file
String. Location of the curator binary.
Default: $::curator::bin_file
#####host
String. Elasticsearch host
Default: localhost
#####port
Integer. Elasticsearch port
Default: 9200
#####use_ssl
Boolean. Use ssl when connecting to Elasticsearch.
Default: false
#####ssl_validate
Boolean. Don't validate the ssl certificate
Default: false
#####http_auth
Boolean. Use basic auth when connecting to Elasticsearch.
Default: false
#####user
String. User name for the http_auth argument. Required if http_auth=true
.
Default: undef
#####password
String. Password for the http_auth argument. Required if http_auth=true
.
Default: undef
#####prefix
String. Prefix for the indices. Indices that do not have this prefix are skipped.
Default: logstash-
#####suffix
String. Suffix for the indices. Indices that do not have this suffix are skipped.
Default: undef
#####regex
String. Regular expression to match indices. Indices that do not match this regexp are skipped.
Default: undef
#####exclude
String or Array of Strings. Indices to skip.
Default: undef
#####index
String or Array of Strings. Indices to explicitly include.
Default: undef
#####snapshot
String or Array of Strings. Snapshot(s) to explicitly include.
Default: undef
#####older_than
Integer. Indices older than this number of $time_units will be matched.
Default: undef
#####newer_than
Integer. Indices newer than this number of $time_units will be matched.
Default: undef
#####time_unit
String. Time unit used for age calculations.
Default: days
Valid options: hours, days, weeks, months
#####timestring
String. Format of index time.
Default: undef
#####master_only
Boolean. Only run command on elected master.
Default: false
#####logfile
String. Logfile to write the output log to
Defalut: /var/log/curator.log
#####log_level
String. Logging level
Default: INFO
#####logformat
String. Log format to write logs in
Default: default
Valid values: default, logstash
#####alias_name
String. Alias to add to indicies when using alias_order
Default: undef
#####remove
Boolean. Remove alias reference instead of add
Default: false
#####rule
String. Rule to apply for allocations
Default: undef
#####disk_space
Integer. Size of index greater than to delete (GB)
Default: undef
#####count
Integer. Number of replicas to set indices to
Default: 2
#####repository
String. Respository to create snapshots in
Default: undef
#####cron_weekday
Cron. Day of the week to schedule the cron entry
Default: *
#####cron_hour
Cron. Hour of the day to schedule the cron entry
Default: 1
#####cron_minute
Cron. Minute of the hour to schedule the cron entry
Default: 10
Private classes
Limitations
Development
Improvements and bug fixes are greatly appreciated. See the contributing guide for information on adding and validating tests for PRs.
Changelog / Contributors
20160214 - v2.3.1 Fixed issue with strict variables 20160214 - v2.3.0 upport SSL certificate path and expose auth parameters at a global level (Greg Swift) 20160113 - v2.2.0 Rename evenup-curator to jlambert121-curator Add support for curator jobs in hiera (Petter Abrahamsson) Add apt/yum repo management & additional ES connection params (Petter Abrahamsson) Add use_ssl and http_auth arguments. (Dan Sajner) 20150828 - v2.1.2 Fixed remove parameter in alias (zyronix) Send cron stdout to /dev/null (mjs510) 20150625 - v2.1.1 Correct inline_templates Correct timestring (SteveDevOps) 20150616 - v2.1.0 Correct logfile parameter location (SteveDevOps) Support repository flag on delete 20150325 - v2.0.1 Correct some command strings Ensure timestring is included 20150324 - v2.0.0 Updated for curator >= 3.0.0 Reworked job defined type - no longer supports multiple jobs Acceptance tests 20141119 - v1.1.0 Added support for --timestring parameter (bflad) Added snapshot_recent, snapshot_delete_order (phononet) Remove single letter args support - removed curator 2.0.2 (phononet) Add support for multiple commands, master-only (bodgit) Remove separator option - removed curator 1.2.0 (dspangen) 20140703 - v1.0.1 Fix ordering for command options 20140703 - v1.0.0 Update for curator >= 1.1.0 20140606 - v0.0.1 Initial release
Dependencies
- puppetlabs/apt (>=2.2.0)
- puppetlabs/stdlib (>=4.2.0 <5.0.0)
Copyright 2013 EvenUp Inc 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.