ansible-macOS-playbook
I try my best to automate as much as I can to set up my Macs for development work.
Installation
(Mostly taken from @geerlingguy 's Mac Development Ansible Playbook as pointed out inthe Credits section)
- Ensure Apple's command line tools are installed (
xcode-select --install
to launch the installer). - Install Ansible:
- Run the following command to add Python 3 to your $PATH:
export PATH="$HOME/Library/Python/3.9/bin:/opt/homebrew/bin:$PATH"
- Note: The version of Python might change when you are running the script. Check the output of
python3 --version
for your Python 3's major and minor version numbers, i.e.3.9
in this command.
- Note: The version of Python might change when you are running the script. Check the output of
- Upgrade Pip:
sudo pip3 install --upgrade pip
- Install Ansible:
pip3 install ansible
- Clone or download this repository.
- Run
ansible-galaxy install -r requirements.yml
inside this directory to install required Ansible roles.. - Run
ansible-playbook main.yml --ask-become-pass
inside this directory. Enter your macOS account password when prompted for the 'BECOME' password.
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.
Credits
This project is heavily inspired by other people's work, namely: