# Bug in include\_vars or jinja2

**URL:** <https://forum.ansible.com/t/bug-in-include-vars-or-jinja2/20481>\
**Category:** Ansible Project\
**Created:** [February 8, 2016, 9:15am UTC](https://forum.ansible.com/t/bug-in-include-vars-or-jinja2/20481 "2016-02-08T09:15:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [February 8, 2016, 9:15am UTC](https://forum.ansible.com/t/bug-in-include-vars-or-jinja2/20481/1 "2016-02-08T09:15:03Z")

</div>

For the last month I have been trying convert my v1 action plugin to v2 with no luck.  
[https://groups.google.com/forum/#!topic/ansible-devel/9-i8uIj9E5g](https://groups.google.com/forum/#!topic/ansible-devel/9-i8uIj9E5g)

So Brian suggested to use default include\_vars with a loop. So decided to try to use ansible built in modules. but the same issue came up that I had in my custom module.

test.yml

`

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 8, 2016, 8:56pm UTC](https://forum.ansible.com/t/bug-in-include-vars-or-jinja2/20481/2 "2016-02-08T20:56:06Z")

</div>

I'm not sure that what you are doing is right, no need to access  
through facts, which would prevent it from templating (security  
issue).  
This example shows that the variable substitution DOES work, as long  
as you access it directly.

vars.yml  
composed\_var: "{{test1}}"

play:

---

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [February 8, 2016, 10:02pm UTC](https://forum.ansible.com/t/bug-in-include-vars-or-jinja2/20481/3 "2016-02-08T22:02:51Z")

</div>

Thank you for your reply.

The objective is to compile a list of variables from files in a directory without using the merge behaviour. In my example I use with\_items but it should be with\_fileglob

var1.yml  
myvar: “example1”

var2.yml  
myvar: “example2”

var3.yml  
myvar: “example3”

compiled\_list:

- myvar: “example1”
- myvar: “example2”
- myvar: “example3”

Since the templating does not happen facts any more. And I dont have the option to enable merge behaviour.  
Any other alternative ?
