title: How can Ansible loop over a sequence of tasks?
body: <p>How can an <a href="http://www.ansible.com/" rel="noreferrer">Ansible</a> playbook <a href="http://docs.ansible.com/ansible/playbooks_loops.html" rel="noreferrer">loop</a> over a sequence of tasks?  I wish to implement a polling loop that executes a task sequence until the task is successful.  When it fails, an exception handler will attempt to fix the condition and then the loop will repeat the task sequence.</p>
  
  <p>Consider the following imaginary example:</p>
  
  <pre><code>- action:
      - block:
          - debug: msg='i execute normally'
          - command: /bin/foo
        rescue:
          - debug: msg='I caught an error'
          - command: /bin/fixfoo
        always:
          - debug: msg="this always executes"
    register: result
    until: result
    retries: 5
    delay: 10
  </code></pre>