# Looping over a list to use with with\_fileglob

**URL:** <https://forum.ansible.com/t/looping-over-a-list-to-use-with-with-fileglob/21990>\
**Category:** Ansible Project\
**Created:** [July 11, 2016, 10:27pm UTC](https://forum.ansible.com/t/looping-over-a-list-to-use-with-with-fileglob/21990 "2016-07-11T22:27:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Tran](https://avatars.discourse-cdn.com/v4/letter/n/e9a140/32.png) [@Nick\_Tran](https://forum.ansible.com/u/Nick_Tran)\
**Post date:** [July 11, 2016, 10:27pm UTC](https://forum.ansible.com/t/looping-over-a-list-to-use-with-with-fileglob/21990/1 "2016-07-11T22:27:26Z")

</div>

I want to loop over a hash list that will provide two items.

1. The file glob
2. the destination

Is this possible via some sort of nested loop and with\_fileglob?

The list would look something like below, and I’m hoping a single ‘copy’ command using with\_fileglob can accomplish it. The list in actuality will be several dozen lines long and passed as a parameter so hardcoding it is not that easy.

list\_of\_items:

- {{ glob: “/path/to/items/\*”, dest: “/new/path/to/items/” }}
- {{ glob: “/path/to/moreitems/\*”, dest: “/new/path/to/moreitems/” }}  
etc

```auto

```

```auto

```

```auto

```
