[ansible-project] Send payload using uri module

2015-10-20 Thread Igor Cicimov
Well first of all if you check the module docs http://docs.ansible.com/ansible/uri_module.html you can see that body_format was introduced in ansible 2.0 so you can't use it in 1.9.1 It also shows an example of supplying the json file to the body parameter that looks much cleaner than what you

Re: [ansible-project] Send payload using uri module

2015-10-20 Thread Sharwari Phadnis
Yes, I tried that. It worked. Thanks. On 21-Oct-2015 9:48 am, "Igor Cicimov" wrote: > Well first of all if you check the module docs > http://docs.ansible.com/ansible/uri_module.html you can see that > body_format was introduced in ansible 2.0 so you can't use it

Re: [ansible-project] Send payload using uri module

2015-10-14 Thread Sharwari Phadnis
--- - hosts: localhost tasks: - uri: url: https://url/to/the/dest/server method: POST user: admin password: default force_basic_auth: yes body: '{JSON payload}' body_format: json register:

[ansible-project] Send payload using uri module

2015-10-14 Thread Sharwari Phadnis
I am trying to *send a payload(in JSON)* to a destination mentioned in the URL. For this purpose I am using* uri module and POST method*. How can I send it using uri module? I am using ansible* version 1.9.1* and when I tried to use *body parameter* for uri module it shows the following error:*

Re: [ansible-project] Send payload using uri module

2015-10-14 Thread David Karban
Hi, this error usually means problem in indentation, body souhld be two spaces deeper I guess. But cannot be sure, as you have not sent your task here :). David Karban Linux server specialist/Specialista na správu linuxových serverů www.karban.eu 2015-10-14 12:59 GMT+02:00 Sharwari Phadnis

Re: [ansible-project] Send payload using uri module

2015-10-14 Thread Sharwari Phadnis
So, to send payload body parameter could be used? On Wednesday, October 14, 2015 at 4:33:29 PM UTC+5:30, David Karban wrote: > > Hi, > > this error usually means problem in indentation, body souhld be two spaces > deeper I guess. But cannot be sure, as you have not sent your task here :). > >

Re: [ansible-project] Send payload using uri module

2015-10-14 Thread Sharwari Phadnis
--- - hosts: localhost tasks: - uri: url: https://url/to/the/dest/server method: POST user: admin password: default force_basic_auth: yes body: '{JSON payload}' body_format: json register: