include_role: causing subsequent dependencies to run more than once. #24326
Labels
affects_2.2
This issue/PR affects Ansible v2.2
bug
This issue/PR relates to a bug.
c:playbook/role_include
include_role
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
ISSUE TYPE
COMPONENT NAME
include_role:
ANSIBLE VERSION
ansible 2.2.0.0
config file = ../playbooks/ansible.cfg
configured module search path = Default w/o overrides
CONFIGURATION
No changes in ansible configuration file
OS / ENVIRONMENT
Ubuntu 16.04
SUMMARY
When include_role: is used (specifically at the end of a .yml) file, it causes that yml file to run repeatedly more than once in all subsequent dependencies.
STEPS TO REPRODUCE
ansible-reported-bug.zip
Attached some sample roles/playbooks which will reproduce the scenario -
DEPENDENCIES IN ATTACHED SAMPLE
-main-calling.yml [Main playbook to run]
- includes [common-test-role]
- [common-test-role] includes role - [common-role-includes-this-another-role] this causes the problem
- includes another role as [first-role-dependent-on-common-test-role] which internally depends on [common-test-role] so common-test-role is running twice when include_role is used inside [common-test-role] at the end, not anywhere else [i.e. in the beginning or in the middle]
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: