# Pause after each iteration in a loop

**URL:** <https://forum.ansible.com/t/pause-after-each-iteration-in-a-loop/25110>\
**Category:** Ansible Project\
**Created:** [July 27, 2017, 4:59pm UTC](https://forum.ansible.com/t/pause-after-each-iteration-in-a-loop/25110 "2017-07-27T16:59:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rambius](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rambius](https://forum.ansible.com/u/rambius)\
**Post date:** [July 27, 2017, 4:59pm UTC](https://forum.ansible.com/t/pause-after-each-iteration-in-a-loop/25110/1 "2017-07-27T16:59:27Z")

</div>

Hello,

Assume we have the following in an inventory

[win\_services]  
host1 services=‘[“service1”, “service2”, “service3”, “service4”]’  
host2 services=‘[“service5”, “service6”, “service7”, “service8”]’  
host3 services=‘[“service9”, “service10”, “service11”, “service12”, “service13”]’  
host4 services=‘[“service14”, “service15”, “service16”, “service17”, “service18”]’  
host5 services=‘[“service19”, “service20”, “service21”, “service22”]’  
host6 services=‘[“service23”, “service24”, “service25”, “service26”]’

Then using win\_nssm we start the above services in the following way

---

<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:** [July 27, 2017, 5:29pm UTC](https://forum.ansible.com/t/pause-after-each-iteration-in-a-loop/25110/2 "2017-07-27T17:29:32Z")

</div>

Put the win\_nssm and the pause task in a file and use  
- include: file.yml  
&nbsp;&nbsp;&nbsp;with\_items: "{{ services }}"

---

<div class="post-metadata">

**Author:** ![rambius](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rambius](https://forum.ansible.com/u/rambius)\
**Post date:** [July 27, 2017, 6:05pm UTC](https://forum.ansible.com/t/pause-after-each-iteration-in-a-loop/25110/3 "2017-07-27T18:05:12Z")

</div>

четвъртък, 27 юли 2017 г., 13:29:54 UTC-4, Kai Stian Olstad написа:

> Put the win\_nssm and the pause task in a file and use
> 
> - include: file.yml  
> with\_items: “{{ services }}”

Thank you. I am trying that.

Regards  
rambius
