# Run sequence of tasks until success

**URL:** <https://forum.ansible.com/t/run-sequence-of-tasks-until-success/27807>\
**Category:** Ansible Project\
**Created:** [June 16, 2018, 8:49am UTC](https://forum.ansible.com/t/run-sequence-of-tasks-until-success/27807 "2018-06-16T08:49:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergei](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@Sergei](https://forum.ansible.com/u/Sergei)\
**Post date:** [June 16, 2018, 8:49am UTC](https://forum.ansible.com/t/run-sequence-of-tasks-until-success/27807/1 "2018-06-16T08:49:48Z")

</div>

Is there a way to run a block of tasks until successful condition? This is what I am trying to achieve:  
- start sequence below  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;task running shell command to generate kerberos ticket  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;task wait\_for\_connection  
&nbsp;&nbsp;&nbsp;retry sequence x times until wait\_for connection is successful

What is the best way to achieve it?It seems that 'block' is not designed for this purpose.
