Registering variables with a loop
You can register the output of a loop as a variable. For example
When you useregisterwith a loop, the data structure placed in the variable will contain aresultsattribute that is a list of all responses from the module. This differs from the data structure returned when usingregisterwithout a loop. Thechanged/failed/skippedattribute that’s beside theresultswill represent the overall state.changed/failedwill betrueif at least one of the iterations triggered a change/failed, whileskippedwill betrueonly if all iterations were skipped.
Subsequent loops over the registered variable to inspect the results may look like
During iteration, the result of the current item will be placed in the variable.