with_filetree

Ansible: generating templates with deep directory structure using with_filetree

If you have a simple directory containing multiple template files that should be generated on a target host, the ‘with_fileglob‘ lookup plugin provides an easy way to render them.  Below is an example rendering all the files from the ‘templates’ directory of a role. – name: create file out of every file in template directory Ansible: generating templates with deep directory structure using with_filetree