This directory contains Ansible automation scripts to set up a consistent development environment on macOS. The automation installs and configures common development tools, applications, and settings to create a ready-to-use development environment.
- 🍺 Homebrew Package Management: Installs Homebrew taps, casks, and formulae
- 🔧 PowerShell Module Installation: Sets up PowerShell modules for development
- 📦 Python Package Management: Installs Python CLI tools via uv
- 🧩 Node.js Package Management: Installs npm packages globally
- ⚙️ .NET Global Tools: Installs .NET global tools (when .NET SDK is available)
- 💻 VS Code Extensions: Configures VS Code with essential development extensions
- 🔄 Git Setup: Configures Git with user information and LFS support
- ⚙️ macOS System Preferences: Applies recommended macOS system preferences
- 🚀 Custom Script Support: Allows for additional customization via custom scripts
- macOS (works on both Intel and Apple Silicon)
- Internet connection
- Administrator (sudo) privileges
This setup has been tested and confirmed to work on:
- macOS Sequoia (15.x)
Some applications may require Rosetta 2, which can be installed automatically by setting install_rosetta: true in
vars.yaml.
-
Get the script:
# Clone the repository if you haven't already git clone https://github.com/ryanspletzer/dev-machine-setup.git cd dev-machine-setup/macOS # Or copy the contents of the macOS directory to somewhere like Downloads if you don't have git installed yet # cd ~/Downloads # Allow the setup.sh script to run chmod 700 ./setup.sh
-
Run the setup script:
# Run the script ./setup.sh -e "your.email@example.com"
The setup.sh script accepts several options:
Usage: ./setup.sh [-v] [-e git_email] [-n git_name] [-p] [-c] [playbook_file]
-v Enable verbose output (can be repeated for more verbosity, e.g. -vv or -vvv)
-e git_email Specify Git user email
-n git_name Specify Git user name
-p Install prerequisites only (Homebrew and Ansible), don't run Ansible playbook
-c CI mode: skip interactive sudo prompts (assumes passwordless sudo)
playbook_file Optional playbook file name (defaults to setup.yaml)-
Basic installation with Git email:
./setup.sh -e "your.email@example.com" -
Install with verbose output and custom Git name:
./setup.sh -v -e "your.email@example.com" -n "Your Name"
-
Install prerequisites only (Homebrew and Ansible):
./setup.sh -p
-
Use a custom playbook file:
./setup.sh -e "your.email@example.com" custom_playbook.yaml
Edit vars.yaml to customize which packages get installed:
# Homebrew taps (repositories)
homebrew_taps:
- aws/tap
- azure/bicep
- azure/functions
- hashicorp/tap
- microsoft/git
# GUI applications
homebrew_casks:
- visual-studio-code
- docker-desktop
- iterm2
# Command-line tools
homebrew_formulae:
- git
- docker
- python# PowerShell modules
powershell_modules:
- AWS.Tools.Common
- Terminal-Icons
# Python packages via pipx (empty on macOS; uv is available via Homebrew)
pipx_packages:
# Python CLI tools via uv
uv_tools:
- poetry
- black
# Node.js global packages
npm_global_packages:
- aws-cdk
- npmrc
# .NET global tools (requires .NET SDK)
dotnet_tools:
- Amazon.Lambda.Tools
# VS Code extensions
vscode_extensions:
- ms-vscode.powershell
- github.copilotThe setup automatically configures macOS with developer-friendly preferences:
- Show hidden files in Finder
- Enable path bar and status bar in Finder
- Disable warnings when changing file extensions
- Prevent .DS_Store file creation on network/USB volumes
- Set Finder to list view by default
- Configure Dock behavior (auto-hide, animation speed)
- Configure TextEdit to use plain text by default
- Configure trackpad settings
You can customize these settings by editing the custom_commands_user and custom_commands_elevated sections in
vars.yaml.
To add additional setup steps:
- Create a custom script in the
examples/directory or elsewhere - Set the
custom_scriptvariable invars.yamlto point to your script - Make sure the script is executable (
chmod +x your_script.sh)
setup.sh: Main setup script that installs prerequisites and runs the Ansible playbooksetup.yaml: Ansible playbook that performs the installation and configurationvars.yaml: Configuration variables defining what gets installedexamples/: Directory containing example custom scripts
For comprehensive documentation and examples:
- Complete Documentation - Full project documentation
- Design Principles - Understanding the philosophy
- Troubleshooting Guide - Common issues and solutions
- Architecture Overview - How all the pieces fit together
- Package Management Strategy - Our approach to managing packages
The default setup includes a curated selection of popular development tools and applications:
- Docker
- Git and Git LFS
- Visual Studio Code
- .NET SDK
- Python, Node.js, Ruby, Go, Rust
- AWS CLI, Azure CLI, Terraform, Packer
- PowerShell
- Global npm packages (AWS CDK, npmrc)
- .NET global tools (Amazon Lambda Tools)
- iTerm2
- git-credential-manager
- Docker Desktop
See vars.yaml for the complete list of installed packages.
The playbook uses tags to allow selective execution of tasks:
system: System-level tasksrosetta: Rosetta 2 installation
homebrew: All Homebrew-related taskstaps: Only Homebrew tapscasks: Only Homebrew casks (applications)formulae: Only Homebrew formulae (CLI tools)
powershell: PowerShell module installationpipx: Python package installation via pipxuv: Python CLI tool installation via uvnpm: Node.js package installation via npmdotnet: .NET global tools installationvscode: VS Code extension installationcursor: Cursor extension installationgit: Git configuration tasksmacos: macOS system preferencespreferences: macOS preference settingsuser-commands: User-level commandselevated-commands: Commands requiring sudo
custom: Custom script execution
- Logs: All installation logs are saved to a timestamped log file in the current directory.
- Verbosity: Use the
-vflag (can be repeated for more detail) to see more information during setup. - Failed Tasks: You can safely rerun the setup script - it will skip already completed tasks.
- The setup script securely handles your sudo password via storing it securely in macOS Keychain and removes it after completion. This is to prevent additional prompts throughout the running of the script.
- All credentials are temporary and cleaned up when the script exits.
- The script only runs commands defined in the Ansible playbook or in your custom commands / custom script.
- Some applications require Rosetta 2. To install it, set
install_rosetta: trueinvars.yaml. - Some Homebrew packages may have compatibility issues with Apple Silicon.