fetch does not support space in file name ?

58 views
Skip to first unread message

Paul Yan

unread,
Sep 29, 2014, 10:23:50 PM9/29/14
to ansible...@googlegroups.com

Hi, 

I just found fetch does not work very well with filenames has spaces in them. so I wrote a test script.
######################################################################
name: report | fetch auditusage report from server
fetch: src="{{ item }}"
          dest=/tmp/fetched
with_items:
    - /tmp/test test.txt 
######################################################################
basically "test.txt" works, "test test.txt" does not.

and here is the error message, looks like it just failed to create the file in local folder, therefore md5sum mismatched. (the whole folder structure on remote server was created locally)
######################################################################
failed: [****.****.com] => (item=/tmp/test test.txt) => {"dest": "/tmp/fetched/****.****.com/tmp/test test.txt", "failed": true, "file": "/tmp/test test.txt", "item": "/tmp/test test.txt", "md5sum": null, "remote_md5sum": "6fa871334b2e8715ef897730f8460553"}
msg: md5 mismatch
######################################################################

any workaround ?
~

Michael DeHaan

unread,
Oct 1, 2014, 8:00:51 AM10/1/14
to ansible...@googlegroups.com
As an initial question, what is ansible --version ?

--
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/a3f1fdd5-fe0b-4dbb-ae13-908a2063f8d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devin Christensen

unread,
Dec 15, 2014, 8:53:28 PM12/15/14
to ansible...@googlegroups.com
Ran into this same issue today on the latest devel branch. When fetching a file with a space in the name and "fail_on_missing: true" I get the error: "the remote file does not exist". Removing the space from the filename fixes it. Here's what my task looks like:

- name: fetch result files
  fetch:
    src: "file_with space"
    dest: "/tmp/dest"
    flat: yes
    fail_on_missing: yes
Reply all
Reply to author
Forward
0 new messages