elway: multi-host fan-out (--hosts a,b,c) #5

Open
opened 2026-04-24 10:40:44 -07:00 by vh · 0 comments
Owner

Currently elway targets a single host per invocation. For fleet-wide operations you for h in host1 host2; do scripts/elway $h ...; done, which works but loses a unified summary.

Proposal

scripts/elway --hosts ana-docker,nh3-docker,esh-docker-vm --playbook playbooks/sweep.yaml
  • Accept --hosts host1,host2,host3 OR repeated --host host flags (positional host arg stays for single-host convenience).
  • Run the playbook per-host; default sequential (parallel adds complexity — ordering, output interleaving, sudo prompts-per-host).
  • Optional --parallel N flag runs N hosts concurrently with buffered output printed per-host after each finishes.
  • Combined summary at the end: one row per host, overall pass/fail aggregate.

Implementation impact

  • Refactor main() to loop over hosts (~20 LOC).
  • Per-host ControlMaster socket (we already create a unique tmpdir; just scope by host).
  • Sudo password prompt: prompt once, reuse across hosts (assumes same password — usually true in a homelab).
  • Output: for sequential runs, what we have today (one-host-at-a-time output) is fine. Parallel mode needs per-host output buffering and a combined summary; defer unless we find ourselves wanting it.

LOE

Sequential: ~30 LOC, afternoon.
Parallel: ~60-80 LOC on top of sequential.

Currently elway targets a single host per invocation. For fleet-wide operations you `for h in host1 host2; do scripts/elway $h ...; done`, which works but loses a unified summary. ### Proposal ```bash scripts/elway --hosts ana-docker,nh3-docker,esh-docker-vm --playbook playbooks/sweep.yaml ``` - Accept `--hosts host1,host2,host3` OR repeated `--host host` flags (positional host arg stays for single-host convenience). - Run the playbook per-host; default **sequential** (parallel adds complexity — ordering, output interleaving, sudo prompts-per-host). - Optional `--parallel N` flag runs N hosts concurrently with buffered output printed per-host after each finishes. - Combined summary at the end: one row per host, overall pass/fail aggregate. ### Implementation impact - Refactor `main()` to loop over hosts (~20 LOC). - Per-host ControlMaster socket (we already create a unique tmpdir; just scope by host). - Sudo password prompt: prompt once, reuse across hosts (assumes same password — usually true in a homelab). - Output: for sequential runs, what we have today (one-host-at-a-time output) is fine. Parallel mode needs per-host output buffering and a combined summary; defer unless we find ourselves wanting it. ### LOE Sequential: ~30 LOC, afternoon. Parallel: ~60-80 LOC on top of sequential.
vh added the enhancement label 2026-04-24 10:40:44 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vh/esh-pfi-infrastructure#5