Forge Home

curator

Installs elasticsearch curator

268,947 downloads

33,052 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 3.5.0 (latest)
  • 3.3.0
  • 3.2.0
  • 3.1.0
  • 3.0.2
  • 3.0.0
released Oct 24th 2017
This version is compatible with:
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'cristifalcas-curator', '3.5.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add cristifalcas-curator
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install cristifalcas-curator --version 3.5.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

cristifalcas/curator — version 3.5.0 Oct 24th 2017

Puppet Forge Build Status

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with curator
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

A puppet module for installing and configuring elastic-curator. This module was forked from jlambert121-curator and updated dor curator4

Module Description

Curator is used to manage and clean up time-series elasticsearch indexes, this module manages curator.

NOTE: If you are using curator < 4.0.0 use a previous version of this module.

The original module allowed you to create various cron jobs for curator.

The new module will only create the config file and one action file. Also, now it it your job to create the cron job:

  cron { "curator_run":
    ensure  => 'present',
    command => '/bin/curator /root/.curator/actions.yml >/dev/null',
    hour    => 1,
    minute  => 10,
    weekday => '*',
  }

Setup

What curator affects

  • curator package
  • curator config

Beginning with curator

Installation of the curator module:

  puppet module install cristifalcas-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::action { 'apache_close':
    action                => 'close',
    continue_if_exception => 'True',
    filters               => [
      {
        'filtertype' => 'age',
        'direction'  => 'older',
        'timestring' => '"%Y.%m.%d"',
        'unit'       => 'days',
        'unit_count' => '2',
        'source'     => 'name',
      }
    ]
  }

Delete logstash indexes older than a week

  curator::action { 'delete_indices':
    action                => 'delete_indices',
    continue_if_exception => 'True',
    filters               => [
      {
        'filtertype' => 'pattern',
        'value'      => 'logstash-',
        'kind'       => 'prefix',
      },
      {
        'filtertype' => 'age',
        'direction'  => 'older',
        'timestring' => '"%Y.%m.%d"',
        'unit'       => 'days',
        'unit_count' => '7',
        'source'     => 'name',
      }
    ]
  }

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

#####ensure String. Version of curator to be installed Default: latest

#####manage_repo Boolean. Enable repo management by enabling the official repositories. Default: false

#####package_provider String. Name of the provider to install the package with. If not specified will use system's default provider. Default: undef

#####repo_version String. Elastic repositories are versioned per major release (2, 3) select here which version you want. Default: false

#####config_file String. Path to configuration file. You must ensure that the directory path exists. Default: '/root/.curator/curator.yml'

#####action_file String. Path to actions file. You must ensure that the directory path exists. Default: '/root/.curator/actions.yml'

#####hosts Array. The hosts where to connect. Default: 'localhost'

#####port Number. The host port where to connect. Default: 9200

#####url_prefix String. In some cases you may be obliged to connect to your Elasticsearch cluster through a proxy of some kind. There may be a URL prefix before the API URI items, e.g. http://example.com/elasticsearch/ as opposed to http://localhost:9200. In such a case, the set the url_prefix to the appropriate value, elasticsearch in this example. Default: empty string

#####use_ssl Boolean. If access to your Elasticsearch instance is protected by SSL encryption, you must use set use_ssl to True. Default: False

#####certificate String. This setting allows the use of a specified CA certificate file to validate the SSL certificate used by Elasticsearch. Default: empty string

#####client_cert String. Allows the use of a specified SSL client cert file to authenticate to Elasticsearch. The file may contain both an SSL client certificate and an SSL key, in which case client_key is not used. If specifying client_cert, and the file specified does not also contain the key, use client_key to specify the file containing the SSL key. The file must be in PEM format, and the key part, if used, must be an unencrypted key in PEM format as well. Default: empty string

#####client_key String. Allows the use of a specified SSL client key file to authenticate to Elasticsearch. If using client_cert and the file specified does not also contain the key, use client_key to specify the file containing the SSL key. The key file must be an unencrypted key in PEM format. Default: empty string

#####aws_key String. This should be an AWS IAM access key, or left empty. Default: empty string

#####aws_secret_key String. This should be an AWS IAM secret access key, or left empty. Default: empty string

#####aws_region String. This should be an AWS region, or left empty. Default: empty string

#####ssl_no_validate Boolean. If access to your Elasticsearch instance is protected by SSL encryption, you may set ssl_no_validate to True to disable SSL certificate verification. Default: False

#####http_auth String. This setting allows basic HTTP authentication to an Elasticsearch instance. This should be a authentication credentials (e.g. user:pass), or left empty. Default: empty string

#####timeout String. You can change the default client connection timeout value with this setting. Default: 30

#####master_only Boolean. In some situations, primarily with automated deployments, it makes sense to install Curator on every node. But you wouldn’t want it to run on each node. By setting master_only to True, this is possible. It tests for, and will only continue running on the node that is the elected master. Default: False

#####loglevel String. Set the minimum acceptable log severity to display. This should be CRITICAL, ERROR, WARNING, INFO, DEBUG, or left empty. Default: INFO

#####logfile String. This should be a path to a log file, or left empty. Default: empty string

#####logformat String. This should default, json, logstash, or left empty. Default: default

#####blacklist String. This should be an empty array [], an array of log handler strings, or left empty. Default: ['elasticsearch', 'urllib3']

Private classes

Limitations

Development

Improvements and bug fixes are greatly appreciated. See the contributing guide for information on adding and validating tests for PRs.