I’d like to walk a directory hierarchy of the form ///. is a fixed root directory, and isn’t relevant. I have a number of directories, which represent machine categories. Under each are zero or more directories, which are string values for that category. Finally, is a directory hierarchy to copy to machines that match the parent / combination. For example:
/tmp/test/color/red/etc/passwd
/tmp/test/color/green/etc/motd
/tmp/test/flavor/cinnamon/var/something
here is /tmp/test. There are two categories (color and flavor): the first (color) has two subdirectories (red and green) and the second (flavor) has one (cinnamon). Each has a different (file hierarchy) to be copied to machines that match /.
How do I walk each , passing its value, its subdirectories, and their subdirectories to a task? I need to consider and together with other vars and facts (machine “colors” and “flavors”) to pick target destinations for .
I’ve looked at the various loop constructs, and see how to chain with register, but not how to populate the lists for with_nested.
Thanks!