# RFC: filetree lookup plugin

**URL:** <https://forum.ansible.com/t/rfc-filetree-lookup-plugin/20484>\
**Category:** Ansible Project\
**Created:** [February 8, 2016, 12:24pm UTC](https://forum.ansible.com/t/rfc-filetree-lookup-plugin/20484 "2016-02-08T12:24:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [February 8, 2016, 12:24pm UTC](https://forum.ansible.com/t/rfc-filetree-lookup-plugin/20484/1 "2016-02-08T12:24:17Z")

</div>

Hi,

At $customer we have a tree of files that need to be distributed, and most of these files actually require to be templated to the target systems.

The playbook is quite complicated as with\_fileglob is carefully written to do the correct actions on the various files, however since this impacts various subdirectories and files it becomes a nuisance to adapt the playbook when changes are made. (e.g. directories have to be created in advance, permissions need to be set individually, etc.)

The solution we implemented is a filetree lookup plugin that simply performs these actions recursively on a tree, which allows us to recursively template files on-the-go. A long set of specific tasks are reduced to basically two tasks.

More information about the filetree plugin is available from PR #14332  
[https://github.com/ansible/ansible/pull/14332](https://github.com/ansible/ansible/pull/14332)

I am looking for feedback on this new plugin, and possible use-cases.  
(More use-cases could be helpful for the unfinished documentation)
