Added task to install templates if es_templates is set
This commit is contained in:
parent
d42fe1b8bb
commit
753c182a70
1 changed files with 11 additions and 0 deletions
11
tasks/elasticsearch-templates.yml
Normal file
11
tasks/elasticsearch-templates.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- name: Copy templates to elasticsearch
|
||||||
|
copy: src=templates dest=/etc/elasticsearch/
|
||||||
|
|
||||||
|
- 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue