[![CI][badge-gh-actions]][link-gh-actions]
Based on the Mac Development Ansible Playbook by Jeff Geerling (geerlingguy).
See the full from-scratch setup document full-mac-setup.md for more details.
Setup goes through the following automated [A] and manual [M] steps.
- [M] Install macOS
- [M] Sign in to iCloud and the App Store and run software update
- [M] Install Xcode command line tools and agree to license
- [M] Install Rosetta (Apple silicon)
- [M] Install apps that won't be handled through automation
- [M] Add
python3
to$PATH
, update packages, and installansible
- [M] Clone or download the (this) Mac Development Ansible Playbook.
- [M] Copy in additional config files and vaults.
- [M] Install requirements and run playbook.
- [A] Ensure OS X Command Line Tools are installed
- [A] Create home directories for source code and websites
- [A] Create SSH key and config, add key to SSH Agent, setup git commit signing
- [A] Install packages and apps with Homebrew
- [A] Install and symlink dotfiles
- [A] Install apps from the Mac App Store
- [A] Configure macOS Dock
- [A] Install packages from other package managers, e.g. composer, pip
- [A] Configure masOS
- [M] Install non-managed software, e.g. Node
- [M] Configure macOS, System Application, User and Cloud Applications
- [M] Manually copy other assets, e.g. fonts, repos, documents
- [M] Clean up temporary artifacts
ansible-playbook main.yml --ask-become-pass --skip-tags "post"
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 pre
, post
, dotfiles
, homebrew
, mas
, extra-packages
and osx
.
ansible-playbook main.yml -K --tags "dotfiles,homebrew"
You can use this playbook to manage other Macs as well; the playbook doesn't even need to be run from a Mac at all! If you want to manage a remote Mac, either another Mac on your network, or a hosted Mac like the ones from MacStadium, you just need to make sure you can connect to it with SSH:
Enable Remote Login on the Mac you want to connect to:
- System Settings -> General -> Sharing -> Remote Login = On
You can also enable remote login on the command line:
`sudo systemsetup -setremotelogin on`
Then edit the inventory
file in this repository and change the line that starts with 127.0.0.1
to:
[ip address or hostname of mac] ansible_user=[mac ssh username]
If you need to supply an SSH password (if you don't use SSH keys), make sure to pass the --ask-pass
parameter to the ansible-playbook
command.