Rewrite exception key on failed_when: false (#85516) (#85517)

* Prevents callback handle_exception from displaying the captured exception when the task is not failed.
* Added tests.


(cherry picked from commit 2fbd7c114e)

Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
Matt Davis
2025-08-04 10:13:42 -05:00
committed by GitHub
co-authored by Matt Clay
parent 68378c85cb
commit 5a20b991d4
4 changed files with 19 additions and 1 deletions
@@ -0,0 +1,4 @@
bugfixes:
- failed_when - When using ``failed_when`` to suppress an error, the ``exception`` key in the result is renamed to ``failed_when_suppressed_exception``.
This prevents the error from being displayed by callbacks after being suppressed.
(https://github.com/ansible/ansible/issues/85505)