My Ansible configuration
First startup - macOS
aka. stuff that you need to do manually
- Install Ansible
Note: There can be some schenanigans with python packages not being in the
PATH. In order to fix that look where ansible was installed. On macOS it should be in~/Library/Python/.../bin. Check if that path is PATH configured in the .bashrc or .zshrc Or just add Python to your PATH:export PATH="$HOME/Library/Python/3.8/bin:/opt/homebrew/bin:$PATH"
- Install required Ansible Galaxy roles
ansible-galaxy install -r requirements.yml
- Run Ansible
ansible-playbook local.yml --ask-become-pass --ask-vault-pass
Enter your macOS account password when prompted for the "BECOME" password Enter my super secret password when prompted for "Vault" password
Note: To skip tasks that require vault password use
--skip-tags vault
Testing configuration
Use Docker for testing if the configuration works fine. The image uses Ubuntu Focal (not macOS!)
Build Docker image
Run Docker container
To test fully you'll need a Virtual machine
Tags
These are the avilable tags to run the playbook partially:
homebrew- packages installed using homebrewappstore- apps installed from AppStoredock- dock configurationmacos- macOS preferences configurationterminal- setting up zshextra-packages- extra packages that are installed using other packages manager or built from sourcedotfiles- dotfiles cloned from separate repositoryvault- tasks that require vault passwordssh- task that installs my ssh keygpg- task that installs my gpg key
Inspired by
Those are the ansible configurations that were an inspiration to mine (aka I've stolen the parts that I liked)