#!/usr/bin/python3 # Pinned to /usr/bin/python3 rather than `env python3` so the script is # immune to an active user virtualenv shadowing system site-packages # (where PyYAML lives on Debian — `apt install python3-yaml`). """ elway — a mini playbook runner over SSH. Named for John Elway: quarterbacks run plays. You hand it a play (a single shell command or an upload), or a playbook (a YAML list of steps + an optional verify phase), and it shoots them across the ssh link with live output, structured reporting, and stop-on-error semantics. Conventions: * Single host per run. Fleet-wide = shell loop outside. * Leverages your ~/.ssh/config aliases. No inventory file. * SSH connection reuse via ControlMaster for multi-step speed. * Sudo password (if needed) prompted once at start, reused via `sudo -S`, never written to disk, never logged. * Simple `{{ var }}` substitution. No Jinja, no filters, no loops. Quick starts: elway irv-ml1 --shell 'docker compose ls' elway irv-ml1 --shell 'mkdir -p /worktank/foo' --sudo elway irv-ml1 --upload stacks/comfyui/compose.yaml:/opt/docker/compose/comfyui/compose.yaml elway irv-ml1 --playbook playbooks/deploy-stack.yaml --var stack=comfyui Playbook schema (YAML): vars: # optional inline defaults; --var CLI overrides stack: comfyui steps: # required list - name: