# include not resolving variables

**URL:** <https://forum.ansible.com/t/include-not-resolving-variables/19014>\
**Category:** Ansible Project\
**Created:** [August 14, 2015, 8:18am UTC](https://forum.ansible.com/t/include-not-resolving-variables/19014 "2015-08-14T08:18:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pujan\_Shah](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@Pujan\_Shah](https://forum.ansible.com/u/Pujan_Shah)\
**Post date:** [August 14, 2015, 8:18am UTC](https://forum.ansible.com/t/include-not-resolving-variables/19014/1 "2015-08-14T08:18:10Z")

</div>

Hi,

I want to use include in a way that every host get’s different playbook.

This is important for me as I have some tasks that are specific to each host.

I can create a custom role where I keep all “semi-manual” and use once stuff related to all hosts in somthing like host\_a.yml host\_b.yml host\_c.yml and than in main playbook I can call include host\_{{ inventory\_hostname }}.yml

This way all my semi-manual and host specific things are also part of my whole setup.

I am not sure if this is possible right now or not but from looking at [https://github.com/ansible/ansible/issues/5424](https://github.com/ansible/ansible/issues/5424) I think it’s not possible.

I can do include\_vars this way but not simple include.

Can someone suggest better alternative if this is not possible?

Regards  
Pujan

---

<div class="post-metadata">

**Author:** ![Ivan\_Voras](https://avatars.discourse-cdn.com/v4/letter/i/ec9cab/32.png) [@Ivan\_Voras](https://forum.ansible.com/u/Ivan_Voras)\
**Post date:** [August 14, 2015, 1:44pm UTC](https://forum.ansible.com/t/include-not-resolving-variables/19014/2 "2015-08-14T13:44:13Z")

</div>

Do you really need variables in includes?

I have something similar, a file named cluster.yml which only includes other files:

---

<div class="post-metadata">

**Author:** ![Pujan\_Shah](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@Pujan\_Shah](https://forum.ansible.com/u/Pujan_Shah)\
**Post date:** [August 14, 2015, 2:27pm UTC](https://forum.ansible.com/t/include-not-resolving-variables/19014/3 "2015-08-14T14:27:38Z")

</div>

In inventory I have a, b and c. Now I want to create user x on a delete file y from b and create file z on c. This is not part of role but let’s say users’s requirement. To do so I can create a role called custom which contains
