header without "=" sign in uri command

102 views
Skip to first unread message

Behdad Forghani

unread,
Feb 19, 2015, 7:20:36 AM2/19/15
to ansible...@googlegroups.com
Hi,

I am trying to automate deployment of ambari cluster with Ansible and I do not seem to be able to get the POST method working.

The command that I use with curl is:

curl --user admin:admin -H 'X-Requested-By:exapackets' -X POST http://c6501:8080/api/v1/blueprints/multinode_cluster -d @blueprint.json


This works fine.


I tried:

uri: user=admin password=admin method=POST force_basic_auth=yes HEADER_=X-Requested-By:exapackets url=http://c6501:8080/api/v1/blueprints/multinode_cluster body="{{ lookup('file','blueprint.json') }}"

and

HEADER_X-Requested-By=exapackets

and

HEADER_X-Requested-By:exapackets=''


None of the seem to work. My suspicion is that the problem is that Ansible expects key=value and in the case of headers, the equal sign becomes part of the header. Any idea?


Of course, for now as a workaround, I am running the curl command as a shell.


Behdad


Reply all
Reply to author
Forward
0 new messages