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

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

--
Dag

Reply via email to