# How do I pass in a vars\_file associated with a specific group/host?

**URL:** <https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163>\
**Category:** Ansible Project\
**Created:** [December 16, 2013, 7:24pm UTC](https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163 "2013-12-16T19:24:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [December 16, 2013, 7:24pm UTC](https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163/1 "2013-12-16T19:24:25Z")

</div>

I have the following yml file:

# Kill RTS components

---

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [December 16, 2013, 8:57pm UTC](https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163/2 "2013-12-16T20:57:04Z")

</div>

It was explained to me by one of my co-workers that “{{ host }}” doesn’t exist and there should probably be a failure prior to executing tasks/realtime\_system/kill.yml.

Is there a way I can get the children of realtime\_system\_components and use that within the vars\_files?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 16, 2013, 8:59pm UTC](https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163/3 "2013-12-16T20:59:59Z")

</div>

“{{ host }}” doesn’t exist, but “{{ inventory\_hostname }}” which is the name of the host in the host loop and “{{ ansible\_hostname }}” which is the name of the discovered hostname of the the host, does exist.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 16, 2013, 9:00pm UTC](https://forum.ansible.com/t/how-do-i-pass-in-a-vars-file-associated-with-a-specific-group-host/14163/4 "2013-12-16T21:00:48Z")

</div>

“Is there a way I can get the children of realtime\_system\_components and use that within the vars\_files”

Sort of. You can see what machines are in any group:

- debug: var=item  
with\_items: groups.webservers

etc
