unarchive module skipping when using with_fileglob

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!

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.

or the new find module