This playbook installs and configures most of the software I use on my Mac.
This playbook defines how to install and set up a machine, but most of the information on what to install and set up is stored in my dotfiles repository. For example, what packages/apps to install, which items to place in the dock, default settings, etc. are all stored as dotfiles.
- Clone or download this repository to your local drive.
- Run
./install.sh
inside this directory. The script will install the required tools and run the playbook. - At the beginning of the playbook, you will be prompted to enter your MacOS
account password (i.e. what you'd use for
sudo
), called the "BECOME" password by Ansible. - You may be prompted for your account password again when installation of
Homebrew cask apps begins. This is because Homebrew uses
sudo
. You can set theansible_become_password
variable to avoid this.
Note
If some Homebrew commands fail,
you might need to agree to Xcode's license or fix some other Brew issue.
Run /opt/homebrew/bin/brew doctor
to see if this is the case.
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, you just need to make sure you can connect to it with SSH:
- On the Mac you want to connect to, go to System Preferences > Sharing.
- Enable 'Remote Login'.
Note
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 -k / --ask-pass
parameter to the ansible-playbook
command.
This project is maintained by Kian Kasad. It was originally forked from Jeff Geerling's mac-dev-playbook, which itself was inspired by MWGriffin/ansible-playbooks.