Execute curl -X with ansible playbook


I want to execute the next command using ansible playbook:

How can I run it?

If I run:

I have the next fail:

fatal: []: FAILED! => {"failed": true, "msg": "ERROR! the 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"}


The best way to do this is to use the URI module:

Since your json file is on the remote machine the easiest way to execute is probably with the shell module:

Leave a Reply