Looping over a list to use with with_fileglob

85 views
Skip to first unread message

Nick Tran

unread,
Jul 11, 2016, 6:33:04 PM7/11/16
to Ansible Project
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



Reply all
Reply to author
Forward
0 new messages