Skip to content

chore(deploy.sh): fail fast if ansible-playbook not on PATH - #48

Closed
KDwevedi wants to merge 1 commit into
ChakshuGautam:chore/ansible-config-driven-deployfrom
KDwevedi:chore/deploy-ansible-precheck
Closed

chore(deploy.sh): fail fast if ansible-playbook not on PATH#48
KDwevedi wants to merge 1 commit into
ChakshuGautam:chore/ansible-config-driven-deployfrom
KDwevedi:chore/deploy-ansible-precheck

Conversation

@KDwevedi

Copy link
Copy Markdown
Collaborator

Problem

deploy.sh's last step is ansible-playbook -i inventory/hosts.yml … playbook-deploy.yml. If ansible isn't on PATH, the script dies with a bare shell error:

deploy.sh: line 63: ansible-playbook: command not found

No hint as to cause or fix. Hit live during a macOS onboarding: pip3 install --user ansible installs ansible-playbook into the Python user-base bin (~/Library/Python/3.x/bin), which macOS does not add to PATHpip "succeeds" but the binary is invisible, so the failure looks like a deploy bug rather than a missing prereq.

Fix

Early command -v ansible-playbook guard (right after cd "$SCRIPT_DIR", before any work). On miss: exit 127 with the exact install options (brew / pipx / pip+PATH) and the ansible-playbook --version verify 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 -n clean.

🤖 Generated with Claude Code

… 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>
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f695b85-a5bf-4149-8ba8-58be70a4ad3b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KDwevedi

Copy link
Copy Markdown
Collaborator Author

Superseded by #52 (consolidated Mac bring-up — 16 commits absorbing this PR + 5 others into one canonical path on nairobi). Closing.

@KDwevedi KDwevedi closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant