2015-09-14 10:32:20 +02:00
|
|
|
---
|
2015-11-25 15:28:09 +00:00
|
|
|
#TODO: How to handle in multi node
|
2015-09-14 10:32:20 +02:00
|
|
|
- name: Copy templates to elasticsearch
|
|
|
|
|
copy: src=templates dest=/etc/elasticsearch/
|
|
|
|
|
|
2015-09-14 12:15:30 +02:00
|
|
|
- name: Wait for elasticsearch to startup
|
|
|
|
|
wait_for: port=9200 delay=10
|
|
|
|
|
|
2015-09-14 10:32:20 +02:00
|
|
|
- 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
|