# Using with\_fileglob with include statement

**URL:** <https://forum.ansible.com/t/using-with-fileglob-with-include-statement/18486>\
**Category:** Ansible Project\
**Created:** [June 12, 2015, 7:38pm UTC](https://forum.ansible.com/t/using-with-fileglob-with-include-statement/18486 "2015-06-12T19:38:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karol\_Stepniewski](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@Karol\_Stepniewski](https://forum.ansible.com/u/Karol_Stepniewski)\
**Post date:** [June 12, 2015, 7:38pm UTC](https://forum.ansible.com/t/using-with-fileglob-with-include-statement/18486/1 "2015-06-12T19:38:07Z")

</div>

Hi,

My goal is to include all playbooks from a certain directory. Those playbooks will be generated dynamically, so I wanted to avoid specifying exact names of each playbook.

I tried:

`

- include: “{{ item }}”  
with\_fileglob:
- gen\_playbooks/\*.yml  
when: # some condition  
`

But I’ve got:

`ERROR: file could not read: /mnt/ansible/{{ item }}`

Looks like {{ item }} is not being evaulated in this context.

Is there any other way to do what I want to achieve?

Best Regards,  
Karol

---

<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:** [June 12, 2015, 8:08pm UTC](https://forum.ansible.com/t/using-with-fileglob-with-include-statement/18486/2 "2015-06-12T20:08:30Z")

</div>

er .. no, but this will work:

ansible-playbook gen\_playbooks/\*.yml
