# Inventory hosts and host vars

**URL:** <https://forum.ansible.com/t/inventory-hosts-and-host-vars/13751>\
**Category:** Ansible Project\
**Created:** [October 23, 2013, 2:01pm UTC](https://forum.ansible.com/t/inventory-hosts-and-host-vars/13751 "2013-10-23T14:01:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbird](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cbird](https://forum.ansible.com/u/cbird)\
**Post date:** [October 23, 2013, 2:01pm UTC](https://forum.ansible.com/t/inventory-hosts-and-host-vars/13751/1 "2013-10-23T14:01:06Z")

</div>

Hey All,

I’m currently using the rax.py file to handle my inventory which is working great. But I’ve now hit a problem, the plugin provides the inventory with the public IP of the instance so if i want to create host\_vars for it i think i have to refer to it by the IP. I’d really like to refer to a host by a name so that i can re-run playbooks without having to rename my host\_var files to work against new IP’s.

Does anyone have any suggestions or alternative approaches on how i might achieve this?

Thanks!

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [October 23, 2013, 4:22pm UTC](https://forum.ansible.com/t/inventory-hosts-and-host-vars/13751/2 "2013-10-23T16:22:06Z")

</div>

This is currently being taken care of in a refactor of the rax.py inventory script.

See [https://github.com/ansible/ansible/pull/4326](https://github.com/ansible/ansible/pull/4326)

Testing would always be welcome, so feel free to pull down that version of rax.py for your use!

---

<div class="post-metadata">

**Author:** ![cbird](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cbird](https://forum.ansible.com/u/cbird)\
**Post date:** [October 24, 2013, 9:07am UTC](https://forum.ansible.com/t/inventory-hosts-and-host-vars/13751/3 "2013-10-24T09:07:03Z")

</div>

Great, thanks for point that out. Will grab it and test it out today!

Chris
