# With fileglob throwing error

**URL:** <https://forum.ansible.com/t/with-fileglob-throwing-error/35142>\
**Category:** Ansible Developer\
**Created:** [May 10, 2021, 12:15pm UTC](https://forum.ansible.com/t/with-fileglob-throwing-error/35142 "2021-05-10T12:15:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lavanya\_Koneru](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@Lavanya\_Koneru](https://forum.ansible.com/u/Lavanya_Koneru)\
**Post date:** [May 10, 2021, 12:15pm UTC](https://forum.ansible.com/t/with-fileglob-throwing-error/35142/1 "2021-05-10T12:15:04Z")

</div>

I am trying to copy files from ansible to remote host with pattern matching  
Giving wildcard pattern is not working for copy

copy:  
src: “{{ item }}”  
dest: /ReleaseMigration  
mode: 0600  
with\_fileglob:

- “/dql\_infashared/Scripts/Deployment/script/\*”

---

<div class="post-metadata">

**Author:** ![jayanth\_reddy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jayanth\_reddy](https://forum.ansible.com/u/jayanth_reddy)\
**Post date:** [May 10, 2021, 12:21pm UTC](https://forum.ansible.com/t/with-fileglob-throwing-error/35142/2 "2021-05-10T12:21:36Z")

</div>

Hello Lavanya,

Greetings!

Hope the attached pattern will work for you.

copy:  
src: /path-of-the-file (path of the file that’s need to copy)  
dest: /path thats need to copy

Regards,  
Jayanthreddy

---

<div class="post-metadata">

**Author:** ![Lavanya\_Koneru](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@Lavanya\_Koneru](https://forum.ansible.com/u/Lavanya_Koneru)\
**Post date:** [May 10, 2021, 1:34pm UTC](https://forum.ansible.com/t/with-fileglob-throwing-error/35142/3 "2021-05-10T13:34:45Z")

</div>

Issue is I need to copy all the files matching the pattern like data\* to destination host path

---

<div class="post-metadata">

**Author:** ![dimndskier](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dimndskier/32/773_2.png) [@dimndskier](https://forum.ansible.com/u/dimndskier)\
**Post date:** [May 10, 2021, 11:16pm UTC](https://forum.ansible.com/t/with-fileglob-throwing-error/35142/4 "2021-05-10T23:16:16Z")

</div>

@Lavanya,  
Make life easier:

1. Provide the full path of three files you want moved from the ansible host to the ansible agent.
2. Provide the full path of the destination.

If nothing else provide them side-by-side for Source path/file → Destination path/file/
