Skip to content

Commit

Permalink
Merge pull request elastic#31 from jakommo/master
Browse files Browse the repository at this point in the history
Changed Readme and added template install
  • Loading branch information
jakommo committed Oct 20, 2015
2 parents a11d095 + 04de4b1 commit 0c6f326
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tasks/elasticsearch-RedHat-version-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

4 changes: 4 additions & 0 deletions tasks/elasticsearch-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions tasks/elasticsearch-templates.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0c6f326

Please sign in to comment.