ansible-role-elasticsearch/README.md

91 lines
2.4 KiB
Markdown
Raw Normal View History

2015-04-30 09:22:14 +02:00
# ansible-elasticsearch
2015-04-30 09:23:14 +02:00
2015-05-13 13:45:13 +02:00
Ansible playbook / roles / tasks for Elasticsearch. Currently it will work on Debian and RedHat based linux systems.
## Usage
Create your ansible playbook with your own tasks, and include the role elasticsearch.
You will have to have this repository accessible within the context of playbook, e.g.
e.g.
```
cd /my/repos/
git clone git@github.com:elastic/ansible-elasticsearch.git
cd /my/ansible/playbook
mkdir -p roles
ln -s /my/repos/ansible-elasticsearch ./roles/elasticsearch
```
2015-05-13 14:22:04 +02:00
Then create your playbook yaml adding the role elasticsearch and overriding any variables you wish. It can be as simple as this to take all the defaults:
2015-05-13 13:45:13 +02:00
```
---
2015-05-13 14:22:04 +02:00
hosts: my_host
roles:
- elasticsearch
tasks:
- .... your tasks ...
```
or more complex..
```
---
hosts: my_host
roles:
- elasticsearch
2015-05-13 13:45:13 +02:00
vars:
java_packages:
- "oracle-java7-installer"
es_major_version: 1.4
es_version: 1.4.4
2015-05-13 14:22:04 +02:00
es_start_service: false
2015-05-13 13:45:13 +02:00
es_plugins_reinstall: false
es_plugins:
2015-05-26 15:12:19 +02:00
- plugin: elasticsearch/elasticsearch-cloud-aws
2015-05-13 13:45:13 +02:00
version: 2.5.0
2015-05-26 15:12:19 +02:00
- plugin: elasticsearch/marvel
2015-05-13 13:45:13 +02:00
version: latest
2015-05-26 15:12:19 +02:00
- plugin: elasticsearch/license
2015-05-13 13:45:13 +02:00
version: latest
2015-05-26 15:12:19 +02:00
- plugin: elasticsearch/shield
2015-05-13 13:45:13 +02:00
version: latest
2015-05-26 15:12:19 +02:00
- plugin: elasticsearch/elasticsearch-support-diagnostics
2015-05-13 13:45:13 +02:00
version: latest
2015-05-26 15:12:19 +02:00
- plugin: lmenezes/elasticsearch-kopf
version: master
2015-05-13 13:45:13 +02:00
tasks:
- .... your tasks ...
```
2015-05-13 14:22:04 +02:00
Make sure your hosts are defined in your ```hosts``` file with the appropriate ```ansible_ssh_host```, ```ansible_ssh_user``` and ```ansible_ssh_private_key_file``` values.
2015-05-13 13:45:13 +02:00
Then run it:
```
ansible-playbook -i hosts ./your-playbook.yml
```
## Configuration
You can add the role without any customisation and it will by default install Java and Elasticsearch, without any plugins.
Following variables affect the versions installed:
2015-05-13 13:45:13 +02:00
* ```es_major_version``` (e.g. "1.5" )
* ```es_version``` (e.g. "1.5.2")
* ```es_start_service``` (true (default) or false)
* ```es_plugins_reinstall``` (true or false (default) )
* ```es_plugins``` (an array of plugin definitons e.g.:
```
es_plugins:
- plugin: elasticsearch-cloud-aws
version: 2.5.0
```
* ```java_repos``` (an array of repositories to be added to allow java to be installed)
* ```java_packages``` (an array of packages to be installed to get Java installed)