B
B
blackbeard2019-03-13 14:47:02
Automation
blackbeard, 2019-03-13 14:47:02

Can you help me with ansible-playbook?

In the playbook for deploying Elasticsearch, I take a step to create indexes, of the form:

- name: Create Elasticsearch indices
  uri: 
    url: "http://127.0.0.1:9200/entry"
    method: PUT
    body: "{{ lookup('file', '/opt/elastic/mapping/entry_mapping.json') }}"
    status_code: 200
    HEADER_Content-Type: "application/json"
    body_format: json

and i get an error
msg: 'An unhandled exception occurred while running the lookup plugin ''file''. Error was a <class ''ansible.errors.AnsibleError''>, original message: could not locate file in lookup: /opt/elastic/mapping/entry_mapping.json'

Please tell me CHADNT? The file is on the server.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
blackbeard, 2019-03-18
@Black_beard_ast

https://docs.ansible.com/ansible/latest/modules/sl...

P
Puma Thailand, 2019-03-13
@opium

The file must be on the Elastict server or it does not exist or is right

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question