I'm unsure what the problem you state with strings is, `loop` also
accepts a list directly:
debug:
msg: one line of {{ item }}
loop:
- item1
- item2
Your proposal is very similar to my preferred design, sadly
loop_control was added prior to loop so we ended up making it 2
directives, but i originally thought:
loop:
over: # list of items
variable: # default 'item', aka 'var
display: # default to variable value, aka 'loop_control.label'
index: # variable that contains the loop index, default index
pause: # default 0
forks: # parallelization, default 1
squash: no|yes # push the loop to run on the remote, default no as
it adds many limitations to loops
until: # end condition for loop, default `index > len(over)`, it
would also eliminate the need of current until/retries keywords
FYI, loop is equivalent to with_list, with_items: '{{mylist}}' is the
same as loop: '{{ mylist|flatten(1)}}', items flattens 1 level of
lists, which is 'magic' that confuses people and that we wanted to
move away from.
The move to loop was also in part to remove the use of 'lookups as
filters' instead of being a plugin that query external data. Since
many of them manipulate existing data for use in loops do the same job
as existing filters .. or they should be filters as that is the
purpose of that plugin type.
--
----------
Brian Coca