Merge pull request #31 from jakommo/master

Changed Readme and added template install
This commit is contained in:
Jakob Reiter 2015-10-20 16:45:22 +02:00
commit 0c6f326bed
5 changed files with 23 additions and 4 deletions

View file

@ -1,10 +1,11 @@
---
es_major_version: "1.7"
es_version: "1.7.0"
es_version: "1.7.1"
es_version_lock: false
es_use_repository: true
es_start_service: true
es_plugins_reinstall: false
es_scripts: false
es_templates: false
es_user: elasticsearch
es_group: elasticsearch

View file

@ -2,5 +2,5 @@
- name: RedHat - install yum-version-lock
yum: name=yum-plugin-versionlock state=present update_cache=yes
- name: RedHat - lock elasticsearch version
command: yum versionlock add elasticsearch
shell: yum versionlock delete 0:elasticsearch* ; yum versionlock add elasticsearch{% if es_version is defined and es_version != "" %}-{{ es_version }}{% endif %}

View file

@ -7,6 +7,10 @@
template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch-{{ es_major_version }}.repo
when: es_use_repository
- name: RedHat - include versionlock
include: elasticsearch-RedHat-version-lock.yml
when: es_version_lock
- name: RedHat - Install Elasticsearch
yum: name=elasticsearch{% if es_version is defined and es_version != "" %}-{{ es_version }}{% endif %} state=present update_cache=yes
when: es_use_repository

View file

@ -0,0 +1,14 @@
---
- name: Copy templates to elasticsearch
copy: src=templates dest=/etc/elasticsearch/
- name: Wait for elasticsearch to startup
wait_for: port=9200 delay=10
- name: Get template files
shell: find . -maxdepth 1 -type f | sed "s#\./##" | sed "s/.json//" chdir=/etc/elasticsearch/templates
register: resultstemplate
- name: Install template(s)
command: 'curl -sL -XPUT http://localhost:9200/_template/{{item}} -d @/etc/elasticsearch/templates/{{item}}.json'
with_items: resultstemplate.stdout_lines

View file

@ -3,8 +3,8 @@
- include: elasticsearch.yml
- include: elasticsearch-plugins.yml
when: es_plugins is defined
- include: elasticsearch-version-lock.yml
when: es_version_lock
- include: elasticsearch-scripts.yml
when: es_scripts
- include: elasticsearch-templates.yml
when: es_templates