Stop execution on hosts with errors, keep running on hosts where it's fine?

15 views
Skip to first unread message

Mihail T

unread,
Jul 28, 2021, 5:22:03 AM7/28/21
to Ansible Project
Hi. How do I make it so Ansible runs on multiple hosts simultaneously, without waiting for all hosts' play finish, but allow them to also keep running plays if a task failed on one or several hosts? The idea is to stop playbook execution on hosts that faced errors but in a way that it wouldn't block other hosts from proceeding with the work after an error occured on hosts with errors.

Vladimir Botka

unread,
Jul 28, 2021, 6:43:54 AM7/28/21
to Mihail T, ansible...@googlegroups.com
On Wed, 28 Jul 2021 02:22:03 -0700 (PDT)
Mihail T <snea...@gmail.com> wrote:

> stop playbook execution on hosts that faced errors

Try block/rescue

- block:
- command: "cmd_that_may_fail"
rescue:
- meta: end_host


--
Vladimir Botka
Reply all
Reply to author
Forward
0 new messages