From ee0dc13fafc5e165924baeef4e29ec368467cb7a Mon Sep 17 00:00:00 2001 From: tomleb Date: Wed, 17 May 2017 16:25:47 -0400 Subject: [PATCH] Add playbook to create the index --- deploy/ansible/create_elasticsearch_index.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 deploy/ansible/create_elasticsearch_index.yml diff --git a/deploy/ansible/create_elasticsearch_index.yml b/deploy/ansible/create_elasticsearch_index.yml new file mode 100644 index 00000000..2f3c65d7 --- /dev/null +++ b/deploy/ansible/create_elasticsearch_index.yml @@ -0,0 +1,18 @@ +- 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 }}"