Get network name as group while sync vcenter inventory

Hello !

I would like to add hosts in a group according to the network name.

I modified the vmware_vm_incentory.py file to add guest.net as properties.
Problem is, I’m having trouble adding only a specific variable from guest.net for key_groups.

Guest.net returns these variables in the host:
guest.net:
- connected: true
deviceConfigId: xxxx
dnsConfig: null
ipAddress:
- xxx.xx.xxx.xx
- ‘xxxx :: xxx: xxxx: xxxx: xxx’
ipConfig:
autoConfigurationEnabled: null
dhcp: null
ipAddress:
- ipAddress: xxx.xx.xxx.xx
lifetime: null
origin: null
prefixLength: 22
state: preferred
- ipAddress: ‘xxxx :: xxx: xxxx: xxxx: xxx’
lifetime: null
origin: null
prefixLength: 64
state: unknown
macAddress: ‘xx: xx: xx: xx: xx: xx’
netBIOSConfig: null
network: production

I want to retrieve only the “network” parameter of the guest.net as a group variable.

(vmware_vm_incentory.py file)
keyed_groups:
description:

  • Add hosts to group based on the values ​​of a variable.
    type: list
    default: [
    {key: ‘guest.guestId’, separator: ‘’},
    {key: ‘summary.runtime.powerState’, separator: ‘’},
    {key: ‘guest.net.network’, separator: ‘’}, ??
    ]

Do you know what syntax to use to retrieve the network parameter of the guest.net property to add hosts to a group following the network name?

Thank you in advance.

Louise