Pre-requisites:
- Xcode Command-Line Tools:
xcode-select --install
- homebrew
# Looks scary, but does the job
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- ansible
brew install ansible
- sudoers with
NOPASSWD: ALL
(some of the tasks requirebecome: yes
and will fail if sudo asks for a password).
- %admin ALL = (ALL) ALL
+ %admin ALL = (ALL) NOPASSWD: ALL
To run the playbook:
ansible-playbook main.yaml
This is configured to install and update the following dotfiles repository.
Most of the defaults
configuration is done through tasks/osx_defaults.yaml
.
Unfortunately, Ansible is lacking dict
and dict-add
support (despite a well done PR) in its osx_defaults
module, so there are a couple of scripts that can be run manually:
files/other_defaults
files/spotlight
files/other_defaults
- Custom keyboard shortcuts require
dict-add
. - Screenshot location (it has
~
in it) is expanded at runtime and is not idempotent.
files/spotlight
- Spotlight configuration removes all volumes but
/
from indexing configuration and re-builds index on/
. - I don't recommend running this often.
This might be a Mojave Beta-only issue, but defaults write
treats all passed values as strings (whether they should be booleans,
integers, or floats) in a construct like this:
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 60 "{ enabled = 1; value = { type = standard; parameters = ( 32, 49, 1048576 ); }; }"
so I have to pass all values in XML format.
Feel free to submit issues, PRs, or just comment.