elasticsearch_curator

Ansible role elasticsearch_curator

Elasticsearch curator for Linux.

GitHub GitLab Downloads Version Issues Pull Requests
github gitlab downloads Version Issues PullRequests

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: true

  pre_tasks:
    - name: Install cron (RedHat).
      yum: name=cronie state=present
      when: ansible_os_family == 'RedHat'

    - name: Install cron (Debian).
      apt: name=cron state=present
      when: ansible_distribution == 'Debian'

    - name: Update apt cache.
      apt: update_cache=yes cache_valid_time=600
      when: ansible_distribution == 'Ubuntu'

    - name: Set pip package for newer distros.
      ansible.builtin.set_fact:
        elasticsearch_curator_pip_package: python3-pip
      when: >
        (ansible_distribution == 'Debian' and ansible_distribution_major_version == '10') or
        (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= '18') or
        (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8')

  roles:
    - role: geerlingguy.repo-epel
      when: ansible_os_family == 'RedHat'
    - role: buluma.elasticsearch_curator

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
elasticsearch_curator_version: ''

elasticsearch_curator_cron_jobs:
  - name: "Run elasticsearch curator actions."
    job: "/usr/local/bin/curator ~/.curator/action.yml"
    minute: 0
    hour: 1

elasticsearch_curator_config_directory: ~/.curator

elasticsearch_curator_hosts:
  - 'localhost:9200'
elasticsearch_curator_http_auth: ''
elasticsearch_curator_yaml: |
  ---
  client:
    hosts: {{ elasticsearch_curator_hosts | to_yaml }}
    url_prefix:
    use_ssl: False
    certificate:
    client_cert:
    client_key:
    ssl_no_validate: False
    http_auth: {{ elasticsearch_curator_http_auth }}
    timeout: 30
    master_only: False
  logging:
    loglevel: INFO
    logfile:
    logformat: default
    blacklist: ['elasticsearch', 'urllib3']

elasticsearch_curator_action_yaml: |
  ---
  actions:
    1:
      action: delete_indices
      options:
        ignore_empty_list: True
        disable_action: False
      filters:
      - filtertype: pattern
        kind: prefix
        value: logstash-
        exclude:
      - filtertype: age
        source: name
        direction: older
        timestring: '%Y.%m.%d'
        unit: days
        unit_count: 45
        exclude:

elasticsearch_curator_pip_package: 'python-pip'

Requirements

State of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub GitLab
buluma.elasticsearch_curator Build Status GitHub Build Status GitLab
geerlingguy.repo-epel Build Status GitHub Build Status GitLab

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles:

dependencies

Compatibility

This role has been tested on these container images:

container tags
EL all
Debian all
Ubuntu all

The minimum version of Ansible required is 2.12, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub

Changelog

Role History

License

Apache-2.0.

Author Information

buluma

Please consider sponsoring me.

Special Thanks

Template inspired by Robert de Bock

Install
ansible-galaxy install buluma/ansible-role-elasticsearch_curator
GitHub repository
License
apache-2.0
Downloads
1906
Owner
DevOps Engineer