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:
- 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. - Custom Scripts: Downloads user scripts to
~/.local/bin(defined inconfig.yml).
- Core Utilities:
git,curl,wget,vim,tmux,htop,sqlite3, plus linters (ansible-lint,yamllint). - Extra Packages:
bat,fzf,xclip,copyq,gh(configurable inconfig.yml). - Build Tools: Installs the dependencies required to compile Python with pyenv.
- Python: Installs
pyenvandpyenv-virtualenvfor managing Python versions. - Node.js: Installs
nvm(Node Version Manager) for managing Node versions.
- Shell: Templates
~/.bashrc_extras(pyenv/nvm init,bat/ll/toclipaliases, fzf key bindings, Starship prompt) and wires it into.bashrc. - Fonts: Installs the Meslo Nerd Font into
~/.local/share/fonts. - Starship: Installs the Starship shell prompt.
- tmux: Deploys a managed
~/.tmux.confwith sensible defaults (mouse support, vi copy mode, 256-color/truecolor, custom status bar). Structured so the TPM plugin manager can be enabled later.
- Container Tools: Docker and related containerization tools.
- HashiCorp: Adds the official HashiCorp apt repository and installs
packerandvagrant. - Vagrant: Installs the
vagrant-libvirtplugin (with its build dependencies) for libvirt providers.
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 (bashrc extras, .bashrc wiring, tmux config)
./setup.sh --tags "dotfiles"
# Only install Python tooling (build dependencies + pyenv)
./setup.sh --tags "python"
# See every available tag
./setup.sh --list-tagsIf 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"