You have a brand new fresh install of OSX on your MacBook and you need to get up and running. You want all your apps installed using Homebrew & Cask and OSX setup with goodies like zsh and .dotfiles.
Use Ansible to deploy CLI apps via Homebrew and GUI Apps via Cask. Then have Ansible setup the shell with zsh and .dotfiles that are pulled from a GitHub repo.
Everything infrastructure is code according to proper DevOps and the MacBook that is the control center for that DevOps is certainly going to be setup using code as much as possible.
- Bring in OSX user settings like desktop backgrounds and other System Preferences.
- Fresh OSX install
- Homebrew installed
- Ansible installed via Homebrew
- GitHub Authenticated
- GitHub API token set
- .dotfiles forked and customized to your liking
Fresh OSX Install
Follow the SysAdmin Bible and read the script before you run it:
Run the script once verified that you know what it will be doing:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Verify Homebrew is correct:
sandor@theargo$ brew doctor
Install Ansible via Homebrew
Installing the latest from dev:
sandor@theargo$ brew install ansible --HEAD
sandor@theargo$ git config --global user.name "sandor" sandor@theargo$ git config --global user.email "firstname.lastname@example.org" sandor@theargo$ ssh-keygen -t rsa -b 4096 -C "sandor@macbook" sandor@theargo$ ssh-add ~/.ssh/id_rsa sandor@theargo$ pbcopy < ~/.ssh/id_rsa.pub
Add your SSH Public Key to GitHub -> Settings.
GitHub API Token Set
This avoids annoying brew errors on lookups.
Download and run the playbook
sandor@theargo$ git clone email@example.com:e30chris/Ansible-MacDeploy.git ~/Codestuff/Ansible/.
- Set the OSX username that is running the playbook in vars/main.yml
sandor@theargo$ ansible-playbook -i hosts site.yml --ask-sudo-pass
Then run the .dotfiles bootstrap script
Now go and setup all the OSX pieces that are not easily Ansibilized like the App Store.