browbeat/ansible/install/roles/es-template/tasks/main.yml

37 lines
1015 B
YAML

---
- name: Upload templates
uri:
url: http://{{ es_ip }}:{{ es_local_port }}/_template/{{ item | basename | regex_replace('\.json','') }}
method: PUT
body: "{{ lookup('file', item) }}"
body_format: json
with_fileglob:
- "{{ browbeat_path }}/elastic/templates/browbeat*"
ignore_errors: true
when: not (elastic5 or elastic7)
- name: Upload templates
uri:
url: http://{{ es_ip }}:{{ es_local_port }}/_template/{{ item | basename | regex_replace('\.json','') }}
method: PUT
body: "{{ lookup('file', item) }}"
body_format: json
with_fileglob:
- "{{ browbeat_path }}/elastic/v5templates/browbeat*"
ignore_errors: true
when: elastic5
- name: Upload templates
uri:
url: http://{{ es_ip }}:{{ es_local_port }}/_template/{{ item | basename | regex_replace('\.json','') }}
method: PUT
body: "{{ lookup('file', item) }}"
body_format: json
with_fileglob:
- "{{ browbeat_path }}/elastic/v7templates/browbeat*"
ignore_errors: true
when: elastic7