-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include_role and meta dependencies: strange behaviour on conditionals #23733
Comments
I like the command lines which is easy to reproduce the issue. |
no idea why dep3 is lost |
The issue is caused by when cause. |
It seems to me that this could be the same bug I reported earlier on 2.2: #23379 |
(repro expanded for reference) ansible.cfg [defaults]\ninventory = ./inventory
nocows = 1 bug.yml ---
- hosts: [ 'localhost' ]
gather_facts: no
roles: [ 'master' ] roles/master/meta/main.yml ---
dependencies:
- role: dep1
- role: dep2
when: false roles/master/tasks/main.yml ---
- include_role: name=dep3 roles/dep*/tasks/main.yml ---
- debug: msg='in {{role_name}}' |
The bug only occurs when using
---
- debug: msg="in master"
---
- hosts: [ 'localhost' ]
gather_facts: no
roles: [ 'master' ]
tasks:
- include_role: name=dep3 resultsTASK [dep1 : task dep1]
ok: [localhost] => {
"msg": "in dep1"
}
TASK [dep2 : task dep2]
skipping: [localhost]
TASK [master : task master]
ok: [localhost] => {
"msg": "in master"
}
TASK [dep3 : task dep3]
ok: [localhost] => {
"msg": "in dep3"
} While playing around with ansible's source code and adding some debug lines I found the following:
full debug log is here with these modifications |
tripleo-inventory depends on the common role, however the role is not include has it should when we use the include_role directive. Here we manually declare the deploy_supplemental_node variable to avoid an undefined value during the role execution See: ansible/ansible#23733 Change-Id: Ibc439b2248a8c80e10718eae47dbdbc3e0ba99e6
This issue was resolved in eeaa676 and included in the v2.3.2 release. If you have further questions please stop by IRC or the mailing list:
|
tripleo-inventory depends on the common role, however the role is not include has it should when we use the include_role directive. Here we manually declare the deploy_supplemental_node variable to avoid an undefined value during the role execution See: ansible/ansible#23733 Change-Id: Ibc439b2248a8c80e10718eae47dbdbc3e0ba99e6
ISSUE TYPE
COMPONENT NAME
role dependencies
ANSIBLE VERSION
CONFIGURATION
n/a
OS / ENVIRONMENT
n/a
SUMMARY
an
include_role
gets skipped when a formerdependency
condition is not metSTEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
verbose output in gist: https://gist.github.com/philfry/8099cc98e12d7b36bf015dd856b2c3cb
The text was updated successfully, but these errors were encountered: