# smart inventory based on inventory variable

**URL:** <https://forum.ansible.com/t/smart-inventory-based-on-inventory-variable/29439>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 15, 2019, 12:04am UTC](https://forum.ansible.com/t/smart-inventory-based-on-inventory-variable/29439 "2019-01-15T00:04:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [January 15, 2019, 12:04am UTC](https://forum.ansible.com/t/smart-inventory-based-on-inventory-variable/29439/1 "2019-01-15T00:04:51Z")

</div>

Hi there, wondering if anyone can point me in the right direction here.

I have a AWX inventory with a variable called “environment”, I want to then create a smart inventory that filters all the inventories which have a variable “environment” which equals “develop”.

I’ve tried some of the following without success, anyone know how to do this?  
variables:develop  
inventory.variables:develop  
inventory.variables.environment:develop

In the meantime, a workaround for me is to put “DEVELOP” in the description of the inventory, then in the smart inventory I can put  
inventory.description:DEVELOP

Just wondering if I can search based on inventory variables.

---

<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:** [January 15, 2019, 12:42pm UTC](https://forum.ansible.com/t/smart-inventory-based-on-inventory-variable/29439/2 "2019-01-15T12:42:42Z")

</div>

You can’t use smart inventory on inventory variables. Only on fact cache data and other “simple” database fields.

---

<div class="post-metadata">

**Author:** ![Adam\_E](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Post date:** [January 15, 2019, 4:58pm UTC](https://forum.ansible.com/t/smart-inventory-based-on-inventory-variable/29439/3 "2019-01-15T16:58:12Z")

</div>

thank you for the confirmation Chris.
