Commit 2a76ab89 authored by Jürgen Haas's avatar Jürgen Haas

Fix mapping update for version >7.x

parent 4c84c7c1
......@@ -5,6 +5,9 @@
uri:
url: 'http://localhost:9200/{{ index }}'
method: HEAD
user: elastic
password: '{{ elasticsearch.users.elastic|default("") }}'
force_basic_auth: yes
register: es_index
failed_when: no
......@@ -13,13 +16,19 @@
url: 'http://localhost:9200/{{ index }}'
method: PUT
status_code: 200
user: elastic
password: '{{ elasticsearch.users.elastic|default("") }}'
force_basic_auth: yes
when: es_index.status != 200
failed_when: no
- name: Update Mapping
uri:
url: 'http://localhost:9200/{{ index }}/_mapping/{{ index }}'
url: 'http://localhost:9200/{{ index }}/_mapping/{{ index }}?include_type_name=true'
method: PUT
user: elastic
password: '{{ elasticsearch.users.elastic|default("") }}'
force_basic_auth: yes
body: '{{ lookup("file", "{{ index }}.json") }}'
status_code: 200
body_format: json
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment