The loop Keyword Over a List
Install many packages in one task.
Stop Copy-Pasting Tasks
Need to install three packages? Writing three near-identical tasks is tedious and error-prone. The loop keyword lets one task repeat over a list. 🔁
What loop Does
Add loop to a task and give it a list. Ansible runs that task once per item, plugging each value into the module's arguments.
All lessons in this course
- The loop Keyword Over a List
- Looping Over Dictionaries
- Nested Loops with subelements
- loop_control: label, index & pause