# How to create a nicer pause...

**URL:** <https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578>\
**Category:** Ansible Project\
**Created:** [September 17, 2016, 12:41pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578 "2016-09-17T12:41:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krist\_van\_Besien](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@Krist\_van\_Besien](https://forum.ansible.com/u/Krist_van_Besien)\
**Post date:** [September 17, 2016, 12:41pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578/1 "2016-09-17T12:41:45Z")

</div>

Hi all,

In one of my playbooks I need to build in a fairly long pause.

So I have this task:

- name: Pause for 20 minutes  
pause: minutes=20

This works, but has the disadvantage that for 20 minutes nothing appears to happen on the screen. I would like to give a bit of feedback. Like a message “still waiting, x minutes to go” every 30 seconds or so. What would be the best way to do this?

Krist

---

<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:** [September 19, 2016, 7:21pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578/2 "2016-09-19T19:21:12Z")

</div>

It's not pretty, but it gives a feedback every 30 seconds.

&nbsp;&nbsp;&nbsp;- name: Pause  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seconds=30  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with\_sequence: start=40 end=0 stride=-1

---

<div class="post-metadata">

**Author:** ![Krist\_van\_Besien](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@Krist\_van\_Besien](https://forum.ansible.com/u/Krist_van_Besien)\
**Post date:** [September 21, 2016, 12:09pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578/3 "2016-09-21T12:09:37Z")

</div>

That works. But this is indeed not that pretty. Is there a way to get rid of the prompt?

I think I might in stead create a loop that just executes “sleep 30”…

Krist

---

<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:** [September 21, 2016, 12:47pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578/4 "2016-09-21T12:47:36Z")

</div>

> > \> Hi all,  
> > \>  
> > \> In one of my playbooks I need to build in a fairly long pause.  
> > \>  
> > \> So I have this task:  
> > \>  
> > \> - name: Pause for 20 minutes  
> > \> pause: minutes=20  
> > \>  
> > \> This works, but has the disadvantage that for 20 minutes nothing appears  
> > to  
> > \> happen on the screen. I would like to give a bit of feedback. Like a  
> > \> message "still waiting, x minutes to go" every 30 seconds or so. What  
> > would  
> > \> be the best way to do this?
> > 
> > It's not pretty, but it gives a feedback every 30 seconds.
> > 
> > &nbsp;&nbsp;&nbsp;- name: Pause  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seconds=30  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with\_sequence: start=40 end=0 stride=-1
> 
> That works. But this is indeed not that pretty. Is there a way to get rid  
> of the prompt?

No.

> I think I might in stead create a loop that just executes "sleep 30"...

This is a solution that looks nice, the downside is it does 40 includes and creates 40 dummy tasks.

pause.yml

---

<div class="post-metadata">

**Author:** ![Josh\_Smift1](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Josh\_Smift1](https://forum.ansible.com/u/Josh_Smift1)\
**Post date:** [September 21, 2016, 1:04pm UTC](https://forum.ansible.com/t/how-to-create-a-nicer-pause/22578/5 "2016-09-21T13:04:07Z")

</div>

How about wait\_for?

&nbsp;&nbsp;- name: count down forty 30-second intervals  
&nbsp;&nbsp;&nbsp;&nbsp;wait\_for: timeout=30  
&nbsp;&nbsp;&nbsp;&nbsp;with\_sequence: start=40 end=0 stride=-1

That gives me output like this:

&nbsp;&nbsp;TASK [count down forty 30-second intervals]
