My Ansible configuration
aka. stuff that you need to do manually
- Install Ansible
pip3 install ansibleNote: 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-passEnter 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
Use Docker for testing if the configuration works fine. The image uses Ubuntu Focal (not macOS!)
Build Docker image
./build-dockerRun Docker container
./run-dockerTo test fully you'll need a Virtual machine
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
Those are the ansible configurations that were an inspiration to mine (aka I've stolen the parts that I liked)