loop

A task keyword that runs the same task once for each item in a list, with the current item available as item.

In more detail

It keeps the action in one place while the data supplies the values that change. Each iteration is reported separately, so one failing item is easy to find. For lists of mappings, read named fields, such as item.name, rather than relying on positions.

Example

loop: "{{ colors }}"

Related terms

Taught in

References

Certification courses