--- # ============================================================================= # Libvirt/KVM Dynamic Inventory Configuration # ============================================================================= # Configuration for libvirt_kvm dynamic inventory plugin # ============================================================================= plugin: libvirt_kvm # Hypervisor Connections # ----------------------------------------------------------------------------- # List of libvirt hypervisors to query hypervisors: - name: grokbox uri: "qemu+ssh://grok@grok.home.serneels.xyz/system" proxy_jump: true description: "Primary KVM hypervisor" # Grouping Configuration # ----------------------------------------------------------------------------- # Automatically create groups based on VM characteristics compose: # Set ansible_host from IP address if available ansible_host: vm_ip_address | default(omit) groups: # Group by VM state running_vms: vm_state == 'running' stopped_vms: vm_state != 'running' # Group by resource allocation small_vms: vm_memory_mb <= 2048 medium_vms: vm_memory_mb > 2048 and vm_memory_mb <= 8192 large_vms: vm_memory_mb > 8192 # Group by hypervisor grokbox_guests: hypervisor == 'grokbox' # Keyed Groups # ----------------------------------------------------------------------------- # Create dynamic groups based on host variables keyed_groups: - key: vm_state prefix: state separator: "_" - key: hypervisor prefix: hypervisor separator: "_" # Filters # ----------------------------------------------------------------------------- # Only include running VMs by default (can be overridden) # strict: false # include_vms: # - running