Ansible Do Until Loop

28 views
Skip to first unread message

Madushan Chathuranga

unread,
May 22, 2018, 4:20:44 AM5/22/18
to Ansible Project
Hi All, 

I'm using ansible version 2.5.0 I'm trying execute a task with an Do Until Loop. 

Is it possible to run this task with an infinite number of retries ?  with out defying the number of retries.
e.g:
until: result.stdout.find("all systems go") != -1
delay: 10 
task will finish only when the condition is success not when number of retries exceeds.

Thanks.

Kai Stian Olstad

unread,
May 22, 2018, 1:58:56 PM5/22/18
to ansible...@googlegroups.com
On 22.05.2018 10:20, Madushan Chathuranga wrote:
> I'm using ansible version 2.5.0 I'm trying execute a task with an Do
> Until
> Loop.
> http://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#do-until-loops
>
> Is it possible to run this task with an infinite number of retries ?
> with
> out defying the number of retries.
> e.g:
>
> until: result.stdout.find("all systems go") != -1delay: 10
>
> task will finish only when the condition is success not when number of
> retries exceeds.

Not to my knowledge, why don't you just set a high retry count?

With a delay 10 and retries 8640, that is 24 hours, and if you increase
the delay to 20 it's 48 hours.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages