# \[AWX 19.3.0\] Smart inventory based on inventory variable

**URL:** <https://forum.ansible.com/t/awx-19-3-0-smart-inventory-based-on-inventory-variable/35844>\
**Category:** AWX Project\
**Tags:** azure, awx\
**Created:** [October 11, 2021, 11:42am UTC](https://forum.ansible.com/t/awx-19-3-0-smart-inventory-based-on-inventory-variable/35844 "2021-10-11T11:42:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divided\_by\_Zer0](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@Divided\_by\_Zer0](https://forum.ansible.com/u/Divided_by_Zer0)\
**Post date:** [October 11, 2021, 11:42am UTC](https://forum.ansible.com/t/awx-19-3-0-smart-inventory-based-on-inventory-variable/35844/1 "2021-10-11T11:42:57Z")

</div>

Hello everyone, I created a dynamic inventory for azure and connected it to my test AWX instance. It creates some variables per host which contain azure information.

I want to make a smart inventory to grab only say, CentOS hosts, or only Linux hosts. These fields exist in my variables but I can’t seem to figure out the format to grab them

I saw an email from a few years go which mentioned that this is not supported, but with my current version, it seems to be possible (see screenshot)

I can get the list of hosts when I my search filter is doing something like “variables\_\_contains:linux” (I do not have proper syntax since AWX seems to create objects now instead of using search strings, see screenshot attached)

But I cannot be more explicit, using something like “variables.virtual\_machine\_size\_\_exact:Standard\_A4\_v2” (Again, if I look for "  
“variables\_\_contains:Standard\_A4\_v2”, I get the hosts I want.

Is this possible? If so, how should I refer to specific keys within my variables?

> **(attachments)**
>
> ![awx_variable_smartinv.png](https://us1.discourse-cdn.com/ansible/original/2X/3/30095710b94496605ed711de8726d78d16510679.png)  
> ![variables_contains_linux.png](https://us1.discourse-cdn.com/ansible/original/2X/a/aa1eedf5572f3296cb32c0a9306e8bef2d59d07d.png)
