chore(deploy.sh): fail fast if ansible-playbook not on PATH - #48
Conversation
… PATH deploy.sh's final step is `ansible-playbook ...`. If ansible isn't on PATH the script dies with a cryptic shell "ansible-playbook: command not found" at that line and the operator has no idea why. Very common macOS trap: `pip3 install --user ansible` installs ansible-playbook into the Python user-base bin, which macOS does NOT add to PATH — pip "succeeds" yet the binary is invisible. Add an early `command -v ansible-playbook` guard that exits 127 with the exact install/PATH fixes (brew / pipx / pip+PATH) and the verify command. Hit live during a macOS onboarding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #52 (consolidated Mac bring-up — 16 commits absorbing this PR + 5 others into one canonical path on |
Problem
deploy.sh's last step isansible-playbook -i inventory/hosts.yml … playbook-deploy.yml. If ansible isn't on PATH, the script dies with a bare shell error:No hint as to cause or fix. Hit live during a macOS onboarding:
pip3 install --user ansibleinstallsansible-playbookinto the Python user-base bin (~/Library/Python/3.x/bin), which macOS does not add to PATH —pip"succeeds" but the binary is invisible, so the failure looks like a deploy bug rather than a missing prereq.Fix
Early
command -v ansible-playbookguard (right aftercd "$SCRIPT_DIR", before any work). On miss: exit 127 with the exact install options (brew/pipx/pip+PATH) and theansible-playbook --versionverify command. No behavior change when ansible is present.Verified: PATH without ansible → actionable error + exit 127; normal PATH → guard passes silently, deploy proceeds unchanged.
bash -nclean.🤖 Generated with Claude Code