You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if include is used to include a tasks list with a nested block, a condition is not evaluated correctly.
STEPS TO REPRODUCE
given a simple role which has an include in main.yml for inc.yml and in inc.yml there is a nested block.
However since the when condition of the outer block is false, no task should be exectued, but the nested block 2.1 is executed.
$ ansible-playbook common.yml -i hosts
PLAY [localhost] ***************************************************************
TASK [common : include] ********************************************************
included: /home/resmo/tmp/test-block/common/tasks/inc.yml for localhost
TASK [common : block 2] *************************************************
skipping: [localhost]
TASK [common : block 2.1] ******************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "this should not run"}
to retry, use: --limit @common.retry
PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1
The text was updated successfully, but these errors were encountered:
resmo
changed the title
include a nested block having conditions results in unexpeced tasks execution
bug: include: block: when: nested block with conditions results in unexpeced tasks execution
May 19, 2016
resmo
changed the title
bug: include: block: when: nested block with conditions results in unexpeced tasks execution
bug: nested block with conditions results in unexpeced tasks execution
May 19, 2016
resmo
changed the title
bug: nested block with conditions results in unexpeced tasks execution
bug: included nested block with conditions results in unexpeced tasks execution
May 19, 2016
We believe the above commit should resolve this problem for you. This will also be included in the next release.
If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.
ISSUE TYPE
ANSIBLE VERSION
SUMMARY
if
include
is used to include a tasks list with a nested block, a condition is not evaluated correctly.STEPS TO REPRODUCE
given a simple role which has an include in
main.yml
forinc.yml
and ininc.yml
there is a nested block.However since the
when
condition of the outer block is false, no task should be exectued, but the nestedblock 2.1
is executed.The bug does not show up without
include
.EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: