Problem
range42-context delete-everything (and any devkit command run inside command substitution $(...)) fails silently in codename-based range42 deployments.
Symptom:
✗ proxmox_vm.list.to.jsons.sh returned no VM data (no vm_id lines) — aborting nuke
Two independent bugs combine to cause this.
Bug 1 — Wrong Ansible host pattern
File: proxmox__inc.jsons.basic_vm_actions.to.jsons.sh
proxmox_node (the PVE cluster node name, e.g. pve) is used as the Ansible - hosts: pattern. In range42, the inventory host key is the infrastructure codename (e.g. hv-lab-01), not the PVE node name.
Ansible warns:
[WARNING]: Could not match supplied host pattern, ignoring: pve
…and produces no output because no host matches.
Root cause: proxmox_node serves two distinct purposes that the devkit conflates:
- PVE cluster node name (
pve) → used by the proxmox_controller role for API calls
- Ansible inventory host key (
hv-lab-01) → used for - hosts: pattern
Bug 2 — Non-TTY empty stdin in command substitution
File: devkit_proxmox.STDIN.stdin_or_jsons.to.jsons.sh
The script uses [ -t 0 ] to decide between using VAULT_NODE (TTY) or reading from stdin (pipe). Inside $() command substitution, stdin is not a TTY even when nothing is piped, so cat - reads empty and produces no output — the entire JSON pipeline returns nothing silently.
Fix
-
proxmox__inc.jsons.basic_vm_actions.to.jsons.sh: introduce ANSIBLE_HOST="${RANGE42_INFRASTRUCTURE_CODENAME:-$PROXMOX_NODE}" and use it for - hosts: while keeping PROXMOX_NODE for the proxmox_node API variable.
-
devkit_proxmox.STDIN.stdin_or_jsons.to.jsons.sh: when cat - returns empty (non-TTY, no stdin provided), fall back to $VAULT_NODE instead of producing no output.
Reproduction
- Codename-based range42 deployment (inventory host =
hv-lab-01, vault proxmox_node = pve)
range42-context use hv-lab-01 <scenario>
range42-context delete-everything → aborts with "no VM data"
Problem
range42-context delete-everything(and any devkit command run inside command substitution$(...)) fails silently in codename-based range42 deployments.Symptom:
Two independent bugs combine to cause this.
Bug 1 — Wrong Ansible host pattern
File:
proxmox__inc.jsons.basic_vm_actions.to.jsons.shproxmox_node(the PVE cluster node name, e.g.pve) is used as the Ansible- hosts:pattern. In range42, the inventory host key is the infrastructure codename (e.g.hv-lab-01), not the PVE node name.Ansible warns:
…and produces no output because no host matches.
Root cause:
proxmox_nodeserves two distinct purposes that the devkit conflates:pve) → used by the proxmox_controller role for API callshv-lab-01) → used for- hosts:patternBug 2 — Non-TTY empty stdin in command substitution
File:
devkit_proxmox.STDIN.stdin_or_jsons.to.jsons.shThe script uses
[ -t 0 ]to decide between usingVAULT_NODE(TTY) or reading from stdin (pipe). Inside$()command substitution, stdin is not a TTY even when nothing is piped, socat -reads empty and produces no output — the entire JSON pipeline returns nothing silently.Fix
proxmox__inc.jsons.basic_vm_actions.to.jsons.sh: introduceANSIBLE_HOST="${RANGE42_INFRASTRUCTURE_CODENAME:-$PROXMOX_NODE}"and use it for- hosts:while keepingPROXMOX_NODEfor theproxmox_nodeAPI variable.devkit_proxmox.STDIN.stdin_or_jsons.to.jsons.sh: whencat -returns empty (non-TTY, no stdin provided), fall back to$VAULT_NODEinstead of producing no output.Reproduction
hv-lab-01, vaultproxmox_node = pve)range42-context use hv-lab-01 <scenario>range42-context delete-everything→ aborts with "no VM data"