Using groupby_custom_field_excludes with the vmware inventory script

263 views
Skip to first unread message

Thibaut V

unread,
Sep 4, 2018, 7:54:20 AM9/4/18
to AWX Project
Hello !

I'm working with the vmware inventory script, in the vmware_inventory.ini i'm trying to use the "groupby_custom_field_excludes" filter but i can't make it work, i didnt found examples on google, do you have some examples to give me ?

i'm already using custom_field_group_prefix with success and the value of groupby_custom_field is set to True.

Thanks for your help

Christopher Meyers

unread,
Sep 4, 2018, 8:40:14 AM9/4/18
to Thibaut V, AWX Project
Awx vendors (copy and paste at a point in time) a copy of ansible's dynamic inventory. We do this because we know it to work with the dependencies that we pin (i.e. boto version for aws or shade version for openstack). Therefore, the feature set of the vendored version may be behind upstream releases of ansible.

With that in mind, in looking at awx vendored version we see custom_field_group_prefix in VMware inventory code here https://github.com/ansible/awx/search?utf8=✓&q=custom_field_group_prefix&type=
In searching the code I don't find any results for groupby_custom_field_excludes. 

Now let's try and find this feature in Ansible. After some googling I see that PR 36877 added support for the feature your looking for! https://github.com/ansible/ansible/pull/36877 From the PR tags we can see that it affects ansible 2.6 so let's go to the 2.6 branch. 

Hmm I wasn't able to find the changes in the 2.6 branch, but here it is in the 2.7 branch! https://github.com/ansible/ansible/blob/stable-2.7/contrib/inventory/vmware_inventory.py

Now we need to get this script into tower. Easiest way is to upload it as a custom inventory script. How do we do that exactly? Well thankfully the paid product version of awx, Ansible Tower, comes with great documentation and is available for FREE to you! https://docs.ansible.com/ansible-tower/latest/html/administration/custom_inventory_script.html

Note: On a plane when I wrote this, with way too much time. Your welcome.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/f00f5cf3-248e-4bb7-be86-5e3f4bfd697f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thibaut V

unread,
Sep 4, 2018, 9:29:25 AM9/4/18
to AWX Project
Many Thanks for all this information, it was just not working because i didnt take the last vmware_inventory.py script available,

For my needs it works perfectly configuring it this way (just the key, not the value): groupby_custom_field_excludes="com.emc.avamar.vmware.snapshot"

Reply all
Reply to author
Forward
0 new messages