# awx smart inventory: problem to get ansible\_facts

**URL:** <https://forum.ansible.com/t/awx-smart-inventory-problem-to-get-ansible-facts/27797>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 14, 2018, 11:13am UTC](https://forum.ansible.com/t/awx-smart-inventory-problem-to-get-ansible-facts/27797 "2018-06-14T11:13:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano1](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@Stefano1](https://forum.ansible.com/u/Stefano1)\
**Post date:** [June 14, 2018, 11:13am UTC](https://forum.ansible.com/t/awx-smart-inventory-problem-to-get-ansible-facts/27797/1 "2018-06-14T11:13:18Z")

</div>

Hi,

I’m trying to create smart inventories on the base of major operating system version  
unfortunately in the facts received from the hosts the entry is received as ansible\_distribution\_major\_version: ‘7’  
and, probably due to the presence of ’ character I’m not able to match the os version with smart host filter search string similar to ansible\_facts.ansible\_distribution\_major\_version:‘7’  
I did many attempts with many variations of ‘7’ but without success  
Do someone have any idea how to solve the problem ?

Thanks  
Stefano

---

<div class="post-metadata">

**Author:** ![Sujith\_A\_R1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sujith\_A\_R1](https://forum.ansible.com/u/Sujith_A_R1)\
**Post date:** [June 15, 2018, 6:16pm UTC](https://forum.ansible.com/t/awx-smart-inventory-problem-to-get-ansible-facts/27797/2 "2018-06-15T18:16:05Z")

</div>

Can you try with this filter. This isn’t perfect but give a try

variables:linux  
variables:7  
variables:running

---

<div class="post-metadata">

**Author:** ![Stefano1](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@Stefano1](https://forum.ansible.com/u/Stefano1)\
**Post date:** [June 18, 2018, 10:13am UTC](https://forum.ansible.com/t/awx-smart-inventory-problem-to-get-ansible-facts/27797/3 "2018-06-18T10:13:11Z")

</div>

Dear Sujith A R

I tried what you suggested but unfortunately without successfrom my point of view, presenting facts with the following format

ansible\_distribution\_file\_parsed: true  
ansible\_distribution\_file\_path: /etc/redhat-release  
ansible\_distribution\_file\_variety: RedHat  
ansible\_distribution\_major\_version: ‘7’  
ansible\_distribution\_release: Core  
ansible\_distribution\_version: 7.5.1804

should be considered a bug

Thanks for your help attempt
