Discussion:
[ansible-project] URL module can not use body from role task
Phill Pafford
2015-07-13 23:04:17 UTC
Permalink
How can I execute a REST call to an API from a role

http://docs.ansible.com/uri_module.html

- name: add ssh key to stash via api
uri:
url: "{{stash_api_url}}"
method: POST
body: '{"text": "value"}'
body_format: json
status_code: 201
HEADER_Content-Type: "application/json"
register: ssh_key_added_to_stash


ERROR: body is not a legal parameter in an Ansible task or handler
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5daa1cb5-446e-4781-bf32-02776375e300%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brian Coca
2015-07-13 23:27:03 UTC
Permalink
indent everything after uri, up to register (non inclusive).
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mxBAwj18T_sipv1W_Z5KMtUEx4mE%2BeigTwJNLbN-iPCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Phill Pafford
2015-07-14 11:39:05 UTC
Permalink
DOH! Thanks that helped! still doesn't solve my issue but at least it does
solve it executing
Post by Brian Coca
indent everything after uri, up to register (non inclusive).
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/500589fc-a39c-4a13-9636-4765426cb1db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...