Reputation: 13859
Given a task that performs a service restart on five different hosts, is it possible to tell ansible that if the restart fails on host1, to abort the entire run without doing the restart on hosts 2-5?
The any_errors_fatal
setting combined with --forks=1
and serial: 1
settings all seem promising but don't seem to it.
- hosts: all
serial: 1
any_errors_fatal: true
become: yes
roles:
- service_control
Upvotes: 3
Views: 128
Reputation: 52385
Can you try setting max_fail_percentage
to zero? From Maximum Failure Percentage
- hosts: all
serial: 1
max_fail_percentage: 0
become: yes
roles:
- service_control
Upvotes: 3