Forked from https://github.com/geerlingguy/mac-dev-playbook
TODO: write bootstrap script to install xcode and Ansible, and run ansible-galaxy install on requirements.yml
- Ensure Apple's command line tools are installed (
xcode-select --install
to launch the installer). - Install Ansible (
sudo easy_install pip
followed bypip install ansible
). See the Ansible install docs for more info. - Clone this repository to your local drive. Note that for mas to work, this has to be run against localhost, not remotely.
- Sign into the Mac App store manually -- this is required for the mas tool to run successfully. See mas-cli/mas#164
- Run
$ ansible-galaxy install -r requirements.yml
inside this directory to install required Ansible roles. - Copy
default.config.tag1.yml
toconfig.yml
. - Optionally enter your MAS email and password (suggest to use ansible-vault to encrypt the password) in order to install MAS apps.
- Run
ansible-playbook main.yml -i inventory -K --ask-vault-pass
inside this directory. You will be prompted for your password, and if you've enabled MAS installations, you may have to enter your iCloud login into a pop up at some point.
Note: If some Homebrew commands fail, you might need to agree to Xcode's license or fix some other Brew issue. Run
brew doctor
to see if this is the case.
Not everyone's development environment and preferred software configuration is the same.
You can override any of the defaults configured in default.config.yml
by creating a config.yml
file and setting the overrides in that file. For example, you can customize the installed packages and apps with something like:
homebrew_installed_packages:
- cowsay
- git
- go
mas_installed_apps:
- { id: 443987910, name: "1Password" }
- { id: 498486288, name: "Quick Resizer" }
- { id: 557168941, name: "Tweetbot" }
- { id: 497799835, name: "Xcode" }
composer_packages:
- name: hirak/prestissimo
- name: drush/drush
version: '^8.1'
gem_packages:
- name: bundler
state: latest
npm_packages:
- name: webpack
pip_packages:
- name: mkdocs
Any variable can be overridden in config.yml
; see the supporting roles' documentation for a complete list of available variables.
Many people have asked me if I often wipe my entire workstation and start from scratch just to test changes to the playbook. Nope! Instead, I posted instructions for how I build a Mac OS X VirtualBox VM, on which I can continually run and re-run this playbook to test changes and make sure things work correctly.