I'd like to walk a directory hierarchy of the form <a>/<b>/<c>/<d>. <a> is a fixed root directory, and isn't relevant. I have a number of <b> directories, which represent machine categories. Under each <b> are zero or more <c> directories, which are string values for that category. Finally, <d> is a directory hierarchy to copy to machines that match the parent <b>/<c> combination. For example:
/tmp/test/color/red/etc/passwd
/tmp/test/color/green/etc/motd
/tmp/test/flavor/cinnamon/var/something
<a> here is /tmp/test. There are two <b> categories (color and flavor): the first (color) has two <c> subdirectories (red and green) and the second (flavor) has one (cinnamon). Each <c> has a different <d> (file hierarchy) to be copied to machines that match <b>/<c>.
How do I walk each <b>, passing its value, its <c> subdirectories, and their <d> subdirectories to a task? I need to consider <b> and <c> together with other vars and facts (machine "colors" and "flavors") to pick target destinations for <d>.
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!