What does `loop_control` provide?
IntermediateConceptJinja2, Conditionals and Loops
Answer
label— what is printed for each item (hides noisy dicts and secrets)loop_var— renameitem, essential in nested includesindex_var— expose the loop indexpause— sleep between iterationsextended: true— addsansible_loop(first, last, length, previtem, nextitem)
loop: "{{ users }}"
loop_control:
label: "{{ item.name }}"
pause: 2
More on Jinja2, Conditionals and Loops
What role does Jinja2 play in Ansible?BeginnerWhat are the three Jinja2 delimiters?BeginnerShow a template with a loop and a conditional, and how it is deployed.BeginnerWhich filters do you use every day?BeginnerHow do you transform lists and dicts with filters (`map`, `select`, `selectattr`, `unique`, `flatten`)?IntermediateHow does `when` work and which operators can you use?Beginner