# vmware\_inventory group\_by

**URL:** <https://forum.ansible.com/t/vmware-inventory-group-by/23284>\
**Category:** Ansible Project\
**Created:** [December 19, 2016, 2:04pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by/23284 "2016-12-19T14:04:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karen\_Tovmasian](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@Karen\_Tovmasian](https://forum.ansible.com/u/Karen_Tovmasian)\
**Post date:** [December 19, 2016, 2:04pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by/23284/1 "2016-12-19T14:04:32Z")

</div>

Hi all.

I’m investigatin the dynamic inventory script "vmware\_inventory.py (this one [https://github.com/ansible/ansible/blob/devel/contrib/inventory/vmware\_inventory.py](https://github.com/ansible/ansible/blob/devel/contrib/inventory/vmware_inventory.py))  
I’d like to know how can i use \_meta vars or other facts to use group\_by to apply a role or run some action on it.  
In \_meta it looks like this

“\_meta”: {  
“hostvars”: {  
“server”: {  
“resourcepool”: {  
“\_moId”: “resgroup-13971”,  
“name”: “myresourcepool”  
},

for instance

`
