I just took a look at the code of the uri module and it looks like src
is accepted but isn't used. (Other file module parameters are also
accepted but not used like mode for file mode). With that support
lacking I don't see any way to upload a binary file via the uri module
currently. So using the command module is going to be your best bet
for now.
If someone is interested in adding src support by opening a pull
request I can take a look at it. Note that if we just work within the
current uri module:
https://github.com/ansible/ansible-modules-core/blob/devel/network/basics/uri.py
then the file will be uploaded from the managed machine. This is
different from the body: "{{ lookup('file', 'filename') }}" approach
given above as that will lookup the file on the ansible controller.
This isn't bad, just different (you can use hosts: localhost or
delegate_to: localhost to get the file from the ansible controller).
-Toshio
> --
> 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-proje...@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/27bcddaa-5795-4110-8571-4e19c1f5a1d3%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.