Fork of unmaintained https://github.com/elastic/ansible-elasticsearch that fixes deprecated syntax
Find a file
2015-07-27 21:49:09 +02:00
defaults Added funktionality to download and install a .deb file instead of using 2015-07-15 20:27:07 +02:00
meta Elasticsearch install on Debian complete 2015-05-12 14:24:31 +02:00
tasks Update apt cache before java install. Good idea to do this for first package and especialy needed for AWS/EC2 2015-07-27 21:49:09 +02:00
templates Changed default variable names so entire hash is not overwritten. Enabled plugin install 2015-05-13 13:33:43 +02:00
test/integration Add tests for new feature 2015-07-16 15:56:09 +02:00
vars Added funktionality to download and install a .deb file instead of using 2015-07-15 20:27:07 +02:00
.gitignore Initial commit for acceptance testing 2015-07-09 16:29:06 +02:00
.kitchen.yml Add tests for new feature 2015-07-16 15:56:09 +02:00
ansible.cfg Install Java on Debian 2015-05-11 16:51:33 +02:00
Gemfile Initial commit for acceptance testing 2015-07-09 16:29:06 +02:00
README.md Move to full-path plugins 2015-05-26 15:12:19 +02:00

ansible-elasticsearch

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

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:

---
hosts: my_host
  roles:
    - elasticsearch
  tasks:
    - .... your tasks ...

or more complex..

---
hosts: my_host
  roles:
    - elasticsearch
  vars:
    java_packages:
      - "oracle-java7-installer"
    es_major_version: 1.4
    es_version: 1.4.4
    es_start_service: false
    es_plugins_reinstall: false
    es_plugins:
      - plugin: elasticsearch/elasticsearch-cloud-aws
        version: 2.5.0
      - plugin: elasticsearch/marvel
        version: latest
      - plugin: elasticsearch/license
        version: latest
      - plugin: elasticsearch/shield
        version: latest
      - plugin: elasticsearch/elasticsearch-support-diagnostics
        version: latest
      - plugin: lmenezes/elasticsearch-kopf
        version: master
  tasks:
    - .... your tasks ...

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.

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:

  • 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)