- name: Create elasticsearch index
hosts: dbs
roles:
- common
- elasticsearch
tasks:
- name: Read configuration file
shell: cat "{{ nyaapantsu_directory }}/elasticsearch_settings.yml"
register: config
- name: Configure elasticsearch index
uri:
headers:
Content-Type: application/yaml
url: "http://localhost:9200/{{ nyaapantsu_elasticsearch_index }}"
method: PUT
body: "{{ config.stdout }}"
- name: Create alias
url: "http://localhost:9200/{{ nyaapantsu_elasticsearch_index }}/_alias/{{ nyaapantsu_elasticsearch_alias }}"