# Compose custom vmware\_vm\_inventory that filters on guestinfo.appInfo

**URL:** <https://forum.ansible.com/t/compose-custom-vmware-vm-inventory-that-filters-on-guestinfo-appinfo/36641>\
**Category:** AWX Project\
**Created:** [May 18, 2022, 10:29am UTC](https://forum.ansible.com/t/compose-custom-vmware-vm-inventory-that-filters-on-guestinfo-appinfo/36641 "2022-05-18T10:29:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AutoKTee](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@AutoKTee](https://forum.ansible.com/u/AutoKTee)\
**Post date:** [May 18, 2022, 10:29am UTC](https://forum.ansible.com/t/compose-custom-vmware-vm-inventory-that-filters-on-guestinfo-appinfo/36641/1 "2022-05-18T10:29:03Z")

</div>

Would like to create a list of servers that have and do not have an application installed. Basically a compose a value that says true if application is installed and false if not based on the guestinfo.appInfo list.

Example value from guestinfo.appInfo

- key: guestinfo.appInfo  
value: |-  
{  
“version”:“1”,  
“updateCounter”:“1455”,  
“publishTime”:“2022-05-18T05:18:18.491Z”,  
“applications”:[  
{“a”:“coreServiceShell.exe”,“v”:“6.1.0.6161”},  
{“a”:“dns.exe”,“v”:“10.0.14393.4283”},  
{“a”:“svchost.exe”,“v”:“10.0.14393.0”},  
{“a”:“winlogbeat.exe”,“v”:“”},  
{“a”:“snowagent.exe”,“v”:“6.7.2.0”},  
{“a”:“winlogon.exe”,“v”:“10.0.14393.3204”},  
{“a”:“conhost.exe”,“v”:“10.0.14393.0”},  
{“a”:“[System Process]”,“v”:“”}]}

I was hoping to be able to assign this to a value to a compose variable that is true or false. Tested with some thing simple that I know works:  
has\_ip: ‘true if guest.net.0.network is defined else false’  
This correctly sets has\_ip to true or false. But cant quite seem to even assign the whole list from guestinfo.appInfo, later on filter on it.

compose:  
ansible\_host: ‘guest.ipAddress’  
app\_list: ‘guestinfo.appInfo’

How can I list guestinfo.appInfo. Tried several things, pipe to flatten and list and resync but I don’t manage to get the variable to be assigned.

Am I approaching this the wrong way? Perhaps creating a playbook to define custom facts and update the host facts is the more Ansible way of going about this?

Any input is much appreciated!

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [May 18, 2022, 7:20pm UTC](https://forum.ansible.com/t/compose-custom-vmware-vm-inventory-that-filters-on-guestinfo-appinfo/36641/2 "2022-05-18T19:20:07Z")

</div>

Hello,

Your question seems to be about using Ansible, not about AWX. [https://groups.google.com/g/ansible-project](https://groups.google.com/g/ansible-project) is the best place to visit for user questions about Ansible. Thanks!

Seth
