nkakouros.elasticsearch
ansible-role-elasticsearch
Overview
This role installs and configures Elasticsearch easily.
What It Does
- Installs Elasticsearch
- Configures Elasticsearch settings
- Sets up secure HTTP and transport TLS
- Creates passwords for built-in user accounts
- Syncs all configurations with the Ansible controller for later use
You can change default settings using a YAML dictionary called elastic_config
.
Requirements
- No additional requirements.
Dependencies
- Java must be installed on the target system.
- Generate certificates for secure communications if needed.
You can use other Ansible roles for these tasks, like geerlingguy.java and nkakouros.easyrsa. Check the example playbook for guidance.
Role Variables
See the defaults/main.yml file for available variables and their descriptions.
By default, this role simply installs Elasticsearch and sets it up as a master, data, and ingest node.
Comparison with Other Roles
Before creating this role, I tried:
These didn’t meet my needs. The first one is too basic and often has delays in updates. The second is complicated with outdated code and confusing documentation.
Example Playbook
Here’s a simple example to quickly install Elasticsearch without certificates for development:
- hosts: elastic-server
roles:
- nkakouros.elasticsearch
For a complete example to set up a full ELK stack, check the molecule/default/ folder. The prepare.yml file installs necessary dependencies, and the playbook.yml file provides a detailed example of using this role.
License
GPLv3
Author
Nikolaos Kakouros (nkak@kth.se)
ansible-galaxy install nkakouros.elasticsearch