This repository contains Ansible playbooks and roles to set up a development environment on a new Ubuntu-based system or container.
This Ansible setup includes the following main components:
- Core system setup
- Git configuration
- Dotfiles management
- Development tools installation
- Ubuntu-based system (tested on Ubuntu 20.04 and later)
- Ansible installed on the target system
-
Clone this repository:
git clone https://github.com/yourusername/ansible-dev-setup.git cd ansible-dev-setup
-
Update the
vars/sensitive
directory with your personal information:- Copy
git_config.yml.example
togit_config.yml
and update with your Git information - Copy
ssh_keys.yml.example
tossh_keys.yml
and add your SSH keys - Set your dotfiles repository URL in
git_config.yml
- Copy
-
Run the Ansible playbook:
ansible-playbook local.yml --ask-become-pass
- Installs essential packages and tools
- Sets up Zsh as the default shell
- Configures SSH
- Configures Git with your personal information
- Sets up global Git preferences
- Clones your dotfiles repository (specified in
git_config.yml
) - Creates symlinks for your configuration files
- Go
- Node.js (via NVM)
- Rust
- Docker
- Visual Studio Code
- Python (with virtual environment)
This setup includes a Python virtual environment. Use the following alias to activate it:
activate_python
You can customize the setup by modifying the roles and tasks in the roles
and tasks
directories. The dotfiles repository URL can be changed in vars/sensitive/git_config.yml
.
To test the setup in a Docker container:
-
Build the test Docker container:
sh build-docker
-
Run the Docker container:
docker run --rm -it nvim-computer bash
-
Inside the container, run the Ansible playbook:
ansible-playbook local.yml --ask-become-pass
Feel free to submit issues or pull requests if you have suggestions for improvements or encounter any problems.