Installs and configures Elasticsearch.
This role will in a configurable manner:
- install Elasticsearch
- configure Elasticsearch
- configure http and transport TLS
- set passwords for built-in users
- sync all the above information with the ansible controller for further use
Configuration happens via a yaml dict (elastic_config
), thus every default
configuration performed by this role can be overridden by defining the
appropriate keys in elastic_config
.
None
- You will need to have java installed on the target system.
- You will need to have generated certificates for use by elasticsearch (if you need to enable encrypted communications)
You can use other ansible roles to perform these tasks, such as geerlingguy.java and nkakouros.easyrsa. See the example playbook.
Look at the defaults/main.yml file for this roles variables and their documentation.
By default, the role will simply install Elasticsearch and start Elasticsearch as a master, data and ingest node.
Before creating this role, I tried to use for my projects the following two roles:
- https://github.com/geerlingguy/ansible-role-elasticsearch
- https://github.com/elastic/ansible-elasticsearch
However, they were not fit for my needs. The first one is too simple and any PRs to add functionality will most likely be stuck in the PR queue for months if not years. The second one is too messy for me with old and hard to read ansible code, a lot of bulk from previous elasticsearch versions and confusing documentation.
This is a minimal playbook to have elasticsearch installed as soon as possible, with no certificates, for development purposes.
- hosts: elastic-server
roles:
- nkakouros.elasticsearch
For a full example on how to configure and install a full ELK installation (from where you can pick what is relevant for your use case) see the molecule/default/ folder. In there, the prepare.yml file contains a playbook that will install dependencies that this role will need. The playbook.yml file will contain a full and complex example of how to use this role specifically.
GPLv3
Nikolaos Kakouros ([email protected])