On Tue, 6 Nov 2018 at 14:23, Léo-San <speculum.al...@gmail.com> wrote:
>
> Hey everyone,
>
> so, I am trying to upload an xml template with the uri module, but I cannot 
> find a way which is working. Mostly I am getting the error "Error in XML 
> file.  Possible mismatch between resource specified in the URL and XML file", 
> but the curl command is working with that file.

Are you sure?
What file did you upload with curl?
Because your task specifies a templated file.
Could it be that the templating has gone wrong in the sense that it
works for Jinja, but the resulting output isn't valid XML?
What happens if you skip the template step, i.e. upload a valid XML
file, i.e. the one that works with curl, but then with ansible?
So instead of:
src: "{{ lookup('template', 'dp_.xml') }}"

just do:

src: /path/to/file/that/works/with/curl.xml

?

If you are going to construct XML, you may want to consider using the
xml module:
https://docs.ansible.com/ansible/latest/modules/xml_module.html

Dick

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwN4r2R_%3Dd9FUyrgM8FXckg86zdx9Z6gMTXvgNf%3Dr77e2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to