unarchive module skipping when using with_fileglob

265 views
Skip to first unread message

Rodrigo B Brasil

unread,
Apr 30, 2015, 9:20:11 AM4/30/15
to ansible...@googlegroups.com
Hello!

I'm pretty new to Ansible, so this may be a stupid thing that I'm (not) doing, but I couldn't find the error by myself.

When I try to use this loop, the gzip file cannot be found and I get the "skipping" message.

  - unarchive: copy=no src={{ item }} dest=/opt/
    with_fileglob
:
     
- /mnt/cd/VMwareTools*.tar.gz

When I put the absolute path to the gzip file within the unarchive module, it works fine:

  - unarchive: copy=no src=/mnt/cd/VMwareTools-8.6.0-425873.tar.gz dest=/opt/

I also tried the /mnt/cd/*.tar.gz and /mnt/cd/* without success.


I'm running: Ansible 1.9.0.1, local host Fedora 21, remote host CentOS 6.6. Thanks!

Matt Martz

unread,
Apr 30, 2015, 9:33:15 AM4/30/15
to ansible...@googlegroups.com
with_fileglob runs locally, not on the remote target machine.

To get a list of files matching a pattern on a remote machine you would need to use something like the command module and ls, and register the results to a variable for later use.
--
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/819c2579-6e31-4598-b660-2b20b4279b8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Brian Coca

unread,
Apr 30, 2015, 9:37:08 AM4/30/15
to ansible...@googlegroups.com
or the new find module



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages