# Related to vars\_files

**URL:** <https://forum.ansible.com/t/related-to-vars-files/13604>\
**Category:** Ansible Project\
**Created:** [October 3, 2013, 3:37pm UTC](https://forum.ansible.com/t/related-to-vars-files/13604 "2013-10-03T15:37:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.ibarra](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@michael.ibarra](https://forum.ansible.com/u/michael.ibarra)\
**Post date:** [October 3, 2013, 3:37pm UTC](https://forum.ansible.com/t/related-to-vars-files/13604/1 "2013-10-03T15:37:47Z")

</div>

Hi all,

I’m stuck using vars\_file correctly. I have the following playbook (livetrack.yml) that it processes roles “lt” and “network”. The LT role copies a vhost.conf file to the httpd conf.d directory with a variable defining the interface which the vhost will listen. And the network role copies network definition for hosts in the inventory.

hosts hostnames: LT1, LT2

What is happening is that the vars are loaded only for the network role. If I run only the playbook with the “lt role” the {{ ip\_address\_o }} variable is never loaded, in comparison if I run only the playbook with the “network role” that it runs smoothly.

_cat livetrack.yml_

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 3, 2013, 3:41pm UTC](https://forum.ansible.com/t/related-to-vars-files/13604/2 "2013-10-03T15:41:27Z")

</div>

You need to make the vhost.conf file a template, and not a file. Right now it’s bypassing the templating completely and you’re just copying it out as-is.

---

<div class="post-metadata">

**Author:** ![michael.ibarra](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@michael.ibarra](https://forum.ansible.com/u/michael.ibarra)\
**Post date:** [October 3, 2013, 3:42pm UTC](https://forum.ansible.com/t/related-to-vars-files/13604/3 "2013-10-03T15:42:20Z")

</div>

Good point, thanks for that.
