Closed dmsimard closed 9 months ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
This seems to be what @s-hertel noticed when reviewing https://github.com/ansible/ansible/pull/76928. Which is that only _load_included_file
sends callbacks for include_tasks
, the if
branch for include_role
does not:
Still an issue as off ansible-core 2.16.1. A failed ansible.builtin.include_tasks (due to target file not existing):
So this results in two log entries that should be one. So +1 here
Summary
When include_role fails -- for example, when it can't find the role it is meant to include -- it does not seem to be considered a failure. The playbook stats summary shows
failed=0
and the task firesv2_runner_on_ok
instead ofv2_runner_on_failed
.The ansible-playbook command exits with exit code 2, correctly detecting the failure.
Issue Type
Bug Report
Component Name
include_role
Ansible Version
Configuration
OS / Environment
Fedora 35, though it should not be relevant to the issue.
Steps to Reproduce
I originally bumped into the issue in ara integration tests with a regular playbook (https://github.com/ansible-community/ara/issues/346) but I've included two reproducers in this gist: https://gist.github.com/dmsimard/8c77ea6db405fbf7b11e8f78f8818afb
Expected Results
The include_role failure should be interpreted as a failure (
v2_runner_on_failed
), NOT as 'ok' viav2_runner_on_ok
.This is my naive view from the perspective of the callback interface, I have not yet investigated why this is happening.
Actual Results
Code of Conduct