Summary
range42-context delete-vms stops VMs successfully but never deletes them. The deletion is silently skipped with a warning:
[WARNING]: Could not match supplied host pattern, ignoring: pve
Root Cause
proxmox_vm.vm_id.delete.to.jsons.sh has no Proxmox API delegation block. It always falls through to the Ansible slow-path via proxmox__inc.jsons.basic_vm_actions.to.jsons.sh, which resolves the Ansible inventory host as:
ANSIBLE_HOST="${RANGE42_INFRASTRUCTURE_CODENAME:-$PROXMOX_NODE}"
When RANGE42_INFRASTRUCTURE_CODENAME is not exported (e.g. sourced_range42.sh not in scope), ANSIBLE_HOST falls back to $PROXMOX_NODE = "pve" (from the JSON line). The inventory does not have a host named pve — it uses the alias local-lab — so Ansible silently skips the play.
The stop_force, start, pause, resume, and stop scripts were all updated in PR #119 with an API delegation guard that bypasses Ansible entirely when the Proxmox HTTPS API is reachable. delete was the only lifecycle script not updated.
Impact
VMs are left running (or stopped but not destroyed) after range42-context delete-vms. Re-running setup-vms then fails with HTTP 500 because the VM ID already exists (vm_clone is not idempotent, see #19).
Fix
See PR for two new files:
proxmox_vm.vm_id.delete_with_api.to.jsons.sh — direct DELETE /qemu/{vm_id} with UPID polling (60 s timeout), modelled after stop_force_with_api.to.jsons.sh
- API delegation guard added to
proxmox_vm.vm_id.delete.to.jsons.sh (same pattern as all other lifecycle scripts)
Set RANGE42_PROXMOX_API_FORCE=off to opt out and keep the Ansible slow-path.
Summary
range42-context delete-vmsstops VMs successfully but never deletes them. The deletion is silently skipped with a warning:Root Cause
proxmox_vm.vm_id.delete.to.jsons.shhas no Proxmox API delegation block. It always falls through to the Ansible slow-path viaproxmox__inc.jsons.basic_vm_actions.to.jsons.sh, which resolves the Ansible inventory host as:ANSIBLE_HOST="${RANGE42_INFRASTRUCTURE_CODENAME:-$PROXMOX_NODE}"When
RANGE42_INFRASTRUCTURE_CODENAMEis not exported (e.g. sourced_range42.sh not in scope),ANSIBLE_HOSTfalls back to$PROXMOX_NODE="pve"(from the JSON line). The inventory does not have a host namedpve— it uses the aliaslocal-lab— so Ansible silently skips the play.The
stop_force,start,pause,resume, andstopscripts were all updated in PR #119 with an API delegation guard that bypasses Ansible entirely when the Proxmox HTTPS API is reachable.deletewas the only lifecycle script not updated.Impact
VMs are left running (or stopped but not destroyed) after
range42-context delete-vms. Re-runningsetup-vmsthen fails with HTTP 500 because the VM ID already exists (vm_clone is not idempotent, see #19).Fix
See PR for two new files:
proxmox_vm.vm_id.delete_with_api.to.jsons.sh— directDELETE /qemu/{vm_id}with UPID polling (60 s timeout), modelled afterstop_force_with_api.to.jsons.shproxmox_vm.vm_id.delete.to.jsons.sh(same pattern as all other lifecycle scripts)Set
RANGE42_PROXMOX_API_FORCE=offto opt out and keep the Ansible slow-path.