Create group base on OS

This commit is contained in:
maynero 2021-05-09 16:13:16 +08:00
parent 4ba99b43ad
commit c76e31d8d9
1 changed files with 8 additions and 0 deletions

View File

@ -367,6 +367,14 @@ def main_list(options, config_path):
}
results['running']['hosts'] += [vm]
if 'proxmox_os_id' in results['_meta']['hostvars'][vm]:
osid = results['_meta']['hostvars'][vm]['proxmox_os_id']
if osid not in results:
results[osid] = {
'hosts': []
}
results[osid]['hosts'] += [vm]
results['_meta']['hostvars'][vm].update(metadata)
# pools