buluma.elasticsearch_curator

Ansible Role: elasticsearch_curator

Elasticsearch curator for Linux systems.

GitHub GitLab Downloads Version Issues Pull Requests
GitHub GitLab Downloads Version Issues Pull Requests

Example Playbook

Here's an example playbook from molecule/default/converge.yml that is tested with every change.

---
- name: Setup Elasticsearch Curator
  hosts: all
  become: true

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

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

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

    - name: Set pip package for newer distributions.
      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

You can also check out a full explanation and example on how to use these roles.

Role Variables

Default values for the role 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 needed to set up the system. You can use different roles if you prefer.

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 part of many compatible roles. You can find more information in the documentation of these roles.

Here’s a quick view of related roles:

Dependencies

Compatibility

This role has been tested on these container images:

Container Tags
EL all
Debian all
Ubuntu all

The minimum required version of Ansible is 2.12. Testing has been done across:

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

If you encounter any issues, please report them on GitHub.

Changelog

See the role history for more information.

License

This project is licensed under Apache-2.0.

Author Information

This role is maintained by buluma.

If you appreciate the work, consider sponsoring me.

Special Thanks

Template inspired by Robert de Bock.

Informazioni sul progetto

Elasticsearch curator for Linux.

Installa
ansible-galaxy install buluma.elasticsearch_curator
Licenza
apache-2.0
Download
1.9k
Proprietario
DevOps Engineer