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
It's not pretty, but it gives a feedback every 30 seconds.
- name: Pause
pause:
seconds=30
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?
I think I might in stead create a loop that just executes “sleep 30”…
Krist
> 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.
- name: Pause
pause:
seconds=30
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
How about wait_for?
- name: count down forty 30-second intervals
wait_for: timeout=30
with_sequence: start=40 end=0 stride=-1
That gives me output like this:
TASK [count down forty 30-second intervals]