How can Ansible loop over a sequence of tasks?
问题 How can an Ansible playbook loop 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. Consider the following imaginary example: - 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"