dynamic inventory

39 views
Skip to first unread message

arpan...@gmail.com

unread,
Nov 15, 2017, 1:28:10 PM11/15/17
to Ansible Project
Is there a way for dynamic inventory in vmware environmnet. Can we use the tags of VMs to do dynamic invetory in ansible.
Any example would help. Thanks.
Meda.

J Davis

unread,
Nov 16, 2017, 4:06:02 PM11/16/17
to Ansible Project
I've been using the vmware_inventory.py inventory script.

The current vmware_inventory.py script uses pyVmomi. The pyVmomi API doesn't support "tags" because that information is in a different database than where that API can currently query (as it was explained to me). You can use custom attributes though and you would need to set the max_object_level=2 or higher to see them.

J Davis

unread,
Nov 16, 2017, 4:15:50 PM11/16/17
to Ansible Project
For examples on how to use a local inventory script, see the online docs: http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html
Reply all
Reply to author
Forward
0 new messages