This playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have some manual installation steps, but at least it's all documented here.
This is a work in progress, and is mostly a means for me to document my current Mac's setup. I'll be evolving this set of playbooks over time.
See also:
- Ensure Apple's command line tools are installed (
xcode-select --installto launch the installer). - Install Ansible.
- Clone this repository to your local drive.
- Run
$ ansible-galaxy install -r requirements.ymlinside this directory to install required Ansible roles. - Run
$ ansible-playbook main.yml -i inventory -Kinside this directory. Enter your account password when prompted.
Note: If some Homebrew commands fail, you might need to agree to Xcode's license or fix some other Brew issue. Run
brew doctorto see if this is the case.
My dotfiles are also installed into the current user's home directory.
You can filter which part of the provisioning process to run by specifying a set of tags using ansible-playbook's --tags flag. The tags available are dotfiles, homebrew, mas, extra-packages.
ansible-playbook main.yml -i inventory -K --tags "dotfiles,homebrew"
- I have vim configuration in the repo, but I still need to add the actual installation:
mkdir -p ~/.vim/autoload mkdir -p ~/.vim/bundle cd ~/.vim/autoload curl https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim > pathogen.vim cd ~/.vim/bundle git clone git://github.com/scrooloose/nerdtree.git
Check out Ansible for DevOps, which teaches you how to automate almost anything with Ansible.
Jeff Geerling, 2014 (originally inspired by MWGriffin/ansible-playbooks).