# Is it possible to associate a host to a variable?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-associate-a-host-to-a-variable/26757>\
**Category:** Ansible Project\
**Created:** [February 16, 2018, 5:19am UTC](https://forum.ansible.com/t/is-it-possible-to-associate-a-host-to-a-variable/26757 "2018-02-16T05:19:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edson\_D\_Agostini](https://avatars.discourse-cdn.com/v4/letter/e/b2d939/32.png) [@Edson\_D\_Agostini](https://forum.ansible.com/u/Edson_D_Agostini)\
**Post date:** [February 16, 2018, 5:19am UTC](https://forum.ansible.com/t/is-it-possible-to-associate-a-host-to-a-variable/26757/1 "2018-02-16T05:19:41Z")

</div>

Greetings,

Would you please let me know if there is a way of associating a host with a variable. In other words,

I have in one test inventory file something like his:

nodenameA nodeNumber=1  
nodenameB nodeNumber=2

nodenameC nodeNumber=3

This works well when running from the CLI, but as now it is being implemented Ansible Tower, I did not find any reference on guides and forums about this association.

Any thought are welcome to help me find a way out of this association or a way to implement it into Tower.  
Regards,  
Ed

---

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [February 19, 2018, 7:39am UTC](https://forum.ansible.com/t/is-it-possible-to-associate-a-host-to-a-variable/26757/2 "2018-02-19T07:39:46Z")

</div>

You can declare variables for individual hosts in tower as well.
