This is because includes before 2.0 were 'preprocessing macros' and did not
evaluate the 'when:' condition at all, most of the time they did not have
the proper data to do so, that is why tasks just inherited the clause. I
know this is confusing as they appear to be 'normal tasks'.

Starting at 2.0, 'task includes' are now dynamic and will work as you
expected, the one exception is when the 'when:' clause fails to 'execute',
Ansible assumes this is because of missing data so it then appends the
clause to the included tasks, which might have the required data in scope.

'Play includes' still work as in 1.9. They use the same keyword `include`
but include full plays instead of just task lists.


----------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7dOmMXS6uSsJKuZQHBUMn3uuUYdBTMs6NGYQ%2BsvkPn9Mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to