mirror of https://github.com/ansible/ansible.git
Merge dd7dc00e8c into 869088b959
commit
efa25e93d3
@ -0,0 +1,3 @@
|
||||
---
|
||||
bugfixes:
|
||||
- Fix the issue of playbook with any_errors_fatal as true, the rescue section only executes on the host where a fail task with run_once as true is triggered, not affecting other hosts as expected.(https://github.com/ansible/ansible/issues/83292)
|
||||
@ -0,0 +1,19 @@
|
||||
- hosts: testhost,testhost2
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(omit) }}"
|
||||
tasks:
|
||||
- block:
|
||||
- debug:
|
||||
msg: Some task running for all hosts
|
||||
- fail:
|
||||
run_once: "{{ run_once | default(omit) }}"
|
||||
- name: any_errors_fatal fails all hosts when any of them fails
|
||||
debug:
|
||||
msg: SHOULD NOT HAPPEN
|
||||
rescue:
|
||||
- name: Rescues both hosts
|
||||
debug:
|
||||
msg: rescuedd
|
||||
- name: You can recover from fatal errors by adding a rescue section to the block.
|
||||
debug:
|
||||
msg: recovered
|
||||
Loading…
Reference in New Issue