# Loop over multiple tasks

**URL:** <https://forum.ansible.com/t/loop-over-multiple-tasks/31774>\
**Category:** Ansible Project\
**Created:** [December 5, 2019, 6:13pm UTC](https://forum.ansible.com/t/loop-over-multiple-tasks/31774 "2019-12-05T18:13:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamie\_Addessi](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jamie\_Addessi](https://forum.ansible.com/u/Jamie_Addessi)\
**Post date:** [December 5, 2019, 6:13pm UTC](https://forum.ansible.com/t/loop-over-multiple-tasks/31774/1 "2019-12-05T18:13:16Z")

</div>

Hello,

Is it possible in Ansible to loop over multiple tasks?

Something like:

`

- loop: “{{ mylist }}”

- name: Task 1  
do something with item step 1

- name: Task 2  
do something with item step 2

- name: Task 3  
do something with item step 3

`

The only way I’ve found to accomplish this is to call out to a tasks file within the loop, and include all 3 tasks there. But it would be nicer to be able to do it in a single playbook.

`

- name: Loop control  
include\_tasks: “tasks.yml”  
loop: “{{ mylist }}”

`

Thanks for any feedback!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 5, 2019, 6:21pm UTC](https://forum.ansible.com/t/loop-over-multiple-tasks/31774/2 "2019-12-05T18:21:47Z")

</div>

This is the only way to do it unfortunately.
