Hi all,
So I too am struggling with this, but I do have some things working to some degree.
Environment Details:
AWX Version: AWX 14.1.0
VCenter Server Version: 6.7.0
ESXi Host Versions: VMware ESXi, 6.0.0, 10719132
Pretty much the only field in the Source to use is the "Source Variables" field. In there I have the following:
******************
---
alias_pattern: "{{ config.name }}"
host_filters: "{{ '<somevalue>' in config.name }},{{ runtime.powerstate == 'poweredOn' }}"
groupby_patterns: "{{ AnsibleGroup }},{{ AnsibleGroup1 }},{{ AnsibleGroup2 }},{{ AnsibleGroup3 }},{{ AnsibleGroup4 }},{{ AnsibleGroup5 }}"
******************
So that <somevalue> is a portion of the hostname that I'm using. I figure you could use other config. values there (i.e. config.guestFullName or config.guestId for OS type).
The groupby_patterns I'm using use VCenter "Custom Attributes". I tried using Tags, but I just can't get it to work.. don't know if it just hasn't been properly implemented yet or maybe it's my mix of VCenter 6.7 with ESX 6.0... not sure but after hours of frustration I gave up and am now setting both custom attributes and tags at build time and hope I can flip to using tags once that gets fully sorted out.
My current struggle is with group_vars. Specifically... how do you set group_vars on a dynamic inventory? Are there some VCenter fields I can use that AWX can grab to populate that info with? What about the "All" group? How do I specify those vars? I believe, at least for the moment, that all I can do is go into the AWX gui (or maybe use the awxkit cli) to set vars on each inventory I have defined (I have a few, since I run multiple environments on each VCenter server and I have defined multiple inventories that have a discrete source for each environment).
Hope some of that info proves helpful.
Best,
Paul