Execute curl -X with ansible playbook
<p>I want to execute the next command using ansible playbook:</p>

<pre><code>curl -X POST -d@mesos-consul.json -H "Content-Type: application/json" http://marathon.service.consul:8080/v2/apps
</code></pre>

<p>How can I run it?</p>

<p>If I run:</p>

<pre><code>- name: post to consul
  uri:
    url: http://marathon.service.consul:8080/v2/apps/
    method: POST
    body: "{{ lookup('file','mesos-consul.json') }}"
    body_format: json
    HEADER_Content-Type: "application/json"
</code></pre>

<p>I have the next fail:</p>

<p><code>fatal: [172.16.8.231]: FAILED! =&gt; {"failed": true, "msg": "ERROR! the</code> <code>file_name '/home/ikerlan/Ik4-Data-Platform/ansible/playbooks/Z_PONER_EN_MARCHA/dns-consul/mesos-consul.j2' does not exist, or is not readable"}</code></p>