Automating provisioning Ubuntu with Ansible on WSL 2
Uses ansible in a WSL 2 Ubuntu instance to provision locally.
Intended to be re-runnable (idempotent) to maintain and update when required.
- Windows 10 or 11.
- WSL 2
sudo apt update && sudo apt install -y ansible
git clone https://github.com/worldofgeese/provision-ubuntu-on-wsl2.git
cd provision-ubuntu-on-wsl2
ansible-galaxy install -r requirements.yml --force
ansible-playbook playbook.yml -i inventory --ask-become-pass -e '{"nix_flakes": true}'
exit
then open a new shell to make Nix available to your environment- Profit 😄
- See the playbook.yml task:
Install apt cmd line apps
for apt packages - aws vault
Description | Command |
---|---|
Find all local info | ansible localhost -m setup |
See vars.yml to configure which tasks get run.