# AWX "inventory\_file" variable

**URL:** <https://forum.ansible.com/t/awx-inventory-file-variable/28757>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [October 10, 2018, 12:36pm UTC](https://forum.ansible.com/t/awx-inventory-file-variable/28757 "2018-10-10T12:36:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Me\_Mo](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Me\_Mo](https://forum.ansible.com/u/Me_Mo)\
**Post date:** [October 10, 2018, 12:36pm UTC](https://forum.ansible.com/t/awx-inventory-file-variable/28757/1 "2018-10-10T12:36:33Z")

</div>

hi

i have a ansible playbook that uses the “inventory\_file” variable in ansible

but in awx/tower this is a tempfile, wich changes.

is there any varibale in awx/tower wich refer to the “name” of the used inventory?

```auto

th@x! 

```

---

<div class="post-metadata">

**Author:** ![Christopher\_Meyers](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Christopher\_Meyers](https://forum.ansible.com/u/Christopher_Meyers)\
**Post date:** [October 19, 2018, 3:30pm UTC](https://forum.ansible.com/t/awx-inventory-file-variable/28757/2 "2018-10-19T15:30:56Z")

</div>

You can use the environment variable INVENTORY\_ID in your playbook in conjunction with the tower\_inventory module to lookup the inventory record in the AWX API to get the inventory name.

[https://docs.ansible.com/ansible/latest/modules/tower\_inventory\_module.html](https://docs.ansible.com/ansible/latest/modules/tower_inventory_module.html)
