I'm confused about where the problem is. Your syntax is fine and the example works, but what prevents you from using the same with_nested loop on other tasks?
Are you looking for a quicker way to reference those items than having to type out the lists over and over again?
The regex items seems like a finite list, which could become a global var. The filenames seem more dynamic so I would probably not permanently store them if they are registered results of other tasks.
Maybe we could offer more help if we understood the real use case here and what you don't* like about the example syntax given.
Are you looking for a quicker way to reference those items than having
to type out the lists over and over again?
yes, I want to specify the array of directories 1 time in 1 place, and not repeat and maintain multiple identical arrays.
after the infile module for example, I want to use the shell module to run a git command in each directory