This Ansible playbook automates the setup of my personal Ubuntu development environment using a role-based architecture.
The project is organized into roles that handle specific aspects of the workstation setup:
- Updates Cache: Refreshes apt repositories.
- Core Utilities:
git,curl,wget,htop,tmux,vim. - Modern CLI:
fastfetch(system info),bat(cat replacement),fzf(fuzzy finder). - Build Tools: Installs dependencies required to build Python and other packages.
- Workspace: Creates standard directory structure:
~/Projects/{Code,Study,Lab,Scratch}. - Security: Generates an Ed25519 SSH key pair.
- Git: Configures global user identity and defaults new branches to
main. - Shell: Wires up
.bashrcwith aliases, tool paths, and environment variables.
- Python: Installs
pyenvandpyenv-virtualenvfor managing Python versions. - Node.js: Installs
nvm(Node Version Manager) for managing Node versions.
- Shell Enhancements: Additional terminal configuration and improvements.
- Container Tools: Docker and related containerization tools.
- Custom Scripts: Downloads custom user scripts to
~/.local/bin.
This project uses a wrapper script to handle permission elevation and user context detection automatically.
To install or update your configuration:
./setup.sh
The setup script passes arguments through to Ansible. You can run specific parts of the configuration using tags:
# Only update dotfiles (aliases, prompt, etc.)
./setup.sh --tags "dotfiles"
# Only update user scripts
./setup.sh --tags "scripts"
If you prefer to run ansible-playbook directly without the wrapper, you must run as root and explicitly inject your user context to ensure file permissions are correct:
sudo ansible-playbook -i inventory local.yml \
-e "ansible_user_id=$(whoami)" \
-e "ansible_user_dir=$HOME"