--- # ============================================================================= # Production Environment - Libvirt/KVM Dynamic Inventory # ============================================================================= # # This inventory uses the custom libvirt_kvm.py plugin to dynamically discover # running VMs on production KVM hypervisors. # # Usage: # ansible-inventory -i inventories/production/libvirt_kvm.yml --list # ansible all -i inventories/production/libvirt_kvm.yml -m ping # # ============================================================================= plugin: libvirt_kvm uri: qemu+ssh://ansible@hypervisor-prod.example.com/system # Connection settings connection_timeout: 30 ssh_proxy_jump: null # Set to bastion host if needed # Filtering states: - running # Grouping keyed_groups: - key: tags.environment prefix: env - key: tags.role prefix: role - key: tags.service prefix: service # Compose variables compose: ansible_host: "{{ ansible_host | default(ip_address) }}" environment: production # Host filters (only include VMs with production tag) # filters: # - tags.environment == 'production'