Hi All,

I raised this potential bug:

https://github.com/ansible/ansible/issues/14325

which has been closed as being a current known limitation, together with a 
referral to the relevant docs 
(http://docs.ansible.com/ansible/playbooks_loops.html#loops-and-includes)

Thing is, my comprehension of the docs supports my expectation of how the 
example code provided in the bug should work, and contradicts the results I 
actually see (granted, the docs do not specifically deal with a looped 
include task, nested within another).

The docs say:

In 2.0 you are able to use with_ loops and task includes (but not playbook 
> includes), this adds the ability to loop over the set of tasks in one shot. 
> There are a couple of things that you need to keep in mind, a included task 
> that has it’s own with_ loop will overwrite the value of the special item 
> variable. So if you want access to both the include’s item and the 
> current task’s item you should use set_fact to create a alias to the 
> outer one.
>

To my mind, this means that as you descend through nested task includes 
that are each passed their own list to iterate over, each included file 
should see the 'item' variable overwritten within their context. This is 
not what I am seeing happening, and am instead seeing the 'item' variable 
set to the value passed to the outer most include and then never being 
overwritten for the inner includes.

Could anybody take a look and see if you think I am reading it wrong, or is 
the bug I raised legitimate?

-- 
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/3c2b8f32-cfd6-4655-a234-3fc5efc91691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to