Skip to content

Instantly share code, notes, and snippets.

@mttjohnson
Last active February 8, 2019 18:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mttjohnson/157fad65a1dcda8649476ea6f645896c to your computer and use it in GitHub Desktop.
Save mttjohnson/157fad65a1dcda8649476ea6f645896c to your computer and use it in GitHub Desktop.
Installing older version of vagrant/ansible with brew
# You can find the current list of casks on github, and the one for vagrant here:
# https://github.com/Homebrew/homebrew-cask/blob/master/Casks/vagrant.rb
# From there you may be able to load the history of that file and lookup previous versions of
# the cask which would be related to previous versions of vagrant as indicated in the cask definition file.
# If the github history of the file fails you can search through recent commit history and find a commit prior
# to the version change you are trying to avoid and get the commit hash before the change and use it to locate
# a previous version of the cask file.
# current (master branch) casks:
# https://raw.githubusercontent.com/Homebrew/homebrew-cask/master/Casks/vagrant.rb
# cask from specific commit (165787c16400978a46ad8cd1abdd9f4fabf7847d):
# https://raw.githubusercontent.com/Homebrew/homebrew-cask/165787c16400978a46ad8cd1abdd9f4fabf7847d/Casks/vagrant.rb
# uninstall vagrant
brew cask uninstall vagrant
# install latest vagrant cask
brew cask install vagrant
# install vagrant at version 2.2.1 as outlined in cask file link contents
brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/165787c16400978a46ad8cd1abdd9f4fabf7847d/Casks/vagrant.rb
# I found the formula in the homebrew-core repo and located history of the forumla for ansible after searching the repo
# https://github.com/Homebrew/homebrew-core/blob/4dc294072201ea7fe97f9477b9b87f57994af4d3/Formula/ansible.rb
# Ansible is a forumula, but works similar to how casks are installed where you can specify the older formula file.
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/4dc294072201ea7fe97f9477b9b87f57994af4d3/Formula/ansible.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment