Last active
April 17, 2020 04:46
-
-
Save mttjohnson/a95f824299c4aab18dae7dfa59af5be4 to your computer and use it in GitHub Desktop.
Ansible Version Switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible version switch | |
# For Ansible 2.6.5 | |
brew uninstall ansible | |
ls /usr/local/Cellar/openssl | |
# switch to openssl version displayed by /usr/local/Cellar/openssl | |
brew switch openssl 1.0.2r | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/4dc294072201ea7fe97f9477b9b87f57994af4d3/Formula/ansible.rb | |
# For Latest (2.9) Ansible Version | |
brew uninstall ansible | |
brew reinstall openssl | |
brew install ansible | |
#!/bin/sh | |
if [ "$1" = "old" ] | |
then | |
echo "Switching to old versions.\n" | |
brew unlink terraform && brew link [email protected] --force | |
brew switch ansible 2.6.5 | |
echo "\n" | |
terraform --version | |
echo "\n" | |
ansible --version | |
elif [ "$1" = "new" ] | |
then | |
echo "Switching to new versions.\n" | |
brew unlink [email protected] && brew link terraform | |
brew switch ansible 2.9.6 | |
echo "\n" | |
terraform --version | |
echo "\n" | |
ansible --version | |
else | |
echo "error: use as" $0 "[old|new]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment