#!/usr/bin/env bash set -euo pipefail if ! command -v python3 >/dev/null 2>&1; then echo "python3 is required" exit 1 fi if ! command -v pip3 >/dev/null 2>&1; then echo "pip3 is required" exit 1 fi python3 -m pip install --user --upgrade pip python3 -m pip install --user "ansible>=9.0.0" "jmespath" "netaddr" ANSIBLE_GALAXY="${HOME}/Library/Python/$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')/bin/ansible-galaxy" if [ -x "${ANSIBLE_GALAXY}" ]; then "${ANSIBLE_GALAXY}" collection install community.general else ansible-galaxy collection install community.general fi echo "Bootstrap complete. Add this to PATH if needed:" echo " export PATH=\"$HOME/Library/Python/$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')/bin:$PATH\""