fastrabbit/ansible/inventories/vmware_vm_inventory.yml
2024-09-19 13:29:35 +03:00

46 lines
946 B
YAML

---
#
# For use:
# ansible-inventory -i /root/ansible/inventories/vmware_vm_inventory.yml --list -y --output zzz.yml
# cat zzz.yml | grep -i "guestid" | sed 's/^ config.guestId: //' | sed 's/$.*//' | sort | uniq
#
plugin: community.vmware.vmware_vm_inventory
strict: true
hostname: "vcs8srv01.lab.loc"
username: "administrator@vsphere.local"
password: "XXXXXXXXX"
validate_certs: false
with_tags: false
with_folders: true
#resources:
# - datacenter:
# - 'DC01'
# resources:
# - compute_resource:
# - Cluster01
# - folder:
# - VLAN-0222
hostnames:
- config.name
properties:
- name
- config.name
- guest
# - config.guestId
- summary.runtime.powerState
# - config.datastoreUrl
- config.template
filters:
- config.template == false
- summary.runtime.powerState == 'poweredOn'
keyed_groups:
- key: summary.runtime.powerState
separator: ''
# - key: ipConfig.network
# separator: ''