Files
zabbix-agent-install/inventory/inventory.proxmox.yml

30 lines
1.1 KiB
YAML

# Proxmox Dynamic Inventory
# Requires PROXMOX_TOKEN_SECRET environment variable to be set
plugin: community.proxmox.proxmox
url: https://192.168.0.166:8006
user: dynamic-inventory@pve
token_id: dynamic-inventory
validate_certs: false
want_facts: true
# Filter to only running machines
filters:
- proxmox_status == 'running'
# Group by Proxmox tags and type
groups:
vms: "'qemu' in proxmox_type"
lxcs: "'lxc' in proxmox_type"
# Tag-based groups - add tags in Proxmox to auto-group
update_targets: "'update' in (proxmox_tags | default([]))"
docker_hosts: "'docker' in (proxmox_tags | default([]))"
kubernetes: "'k8s' in (proxmox_tags | default([]))"
zabbix_targets: "'zabbix' in (proxmox_tags | default([]))"
compose:
# If this host's Proxmox name matches the controller's hostname, connect locally
# instead of SSHing back into the machine running the playbook
ansible_connection: "'local' if name == lookup('pipe', 'hostname') else 'ssh'"
ansible_host: "lookup('pipe', 'hostname') if name == lookup('pipe', 'hostname') else name + '.lan'"
ansible_user: 'jenkins'