Wrong search paths with include_role #34782
Labels
affects_2.5
This issue/PR affects Ansible v2.5
bug
This issue/PR relates to a bug.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
dynamic includes
ANSIBLE VERSION
same on 2.4.0
CONFIGURATION
default configuration
ansible-config dump --only-changed - empty result
OS / ENVIRONMENT
Linux, but it isn't important
SUMMARY
include path are wrong, then using include_roles.
Ansible does not search for tasks in role that use include_tasks.
When we use include_role, the search path is limited only to parent roles.
In the example below, we have roles:
top - which include_role role one
one - which include_role role two
two - which dependency role three
three - which include_task file in her tasks/
when using include_role, included_tasks are search only in one/tasks and two/tasks.
It's bug in my opinion, because it should search in three/tasks as well. (and maybe in top/tasks?)
STEPS TO REPRODUCE
roles/top/tasks/main.yml
roles/one/tasks/main.yml
roles/two/tasks/main.yml
roles/two/meta/main.yml
roles/three/tasks/main.yml
roles/three/tasks/my.yml
playbook_a.yml
playbook_b.yml
EXPECTED RESULTS
ACTUAL RESULTS
and with strace, we can see:
The text was updated successfully, but these errors were encountered: