It would be nice to iterate over local files.
This seems to be done best with a with_items like construct.
better: with_items_from_cmd: find . -name *.txt
with_items_from_pipe ? :)
probably better than arbitrarily dropping vowels :)
Why not just with_items_from?
I could see the need to have both files and commands/pipes. Try and execute the value. If that fails try and read it as a file.
new things available already are
$FILE($var) -- returns the contents of the file inline
$PIPE($cmd) -- runs a command -- may need some work
We can't use $PIPE(cmd) with with_items too well yet... I think what we want to do is detect that $PIPE is used in the with_items clause and if so, and if the stdout of the command includes a newline, convert the command results into a list.
I'm going to solve this a little differently and bring pluggable data sources forward a bit, and allow
where with_items_foo will look for a data module of type foo. Stay tuned, doing this now for 0.8.
$PIPE and $FILE will prob stay around for template usage, though this will be cleaner/easier.
called it with_fileglob instead, see examples/playbooks/loop_plugins.yml