Automating provisioning Ubuntu 20.04 with Ansible on WSL 2
Uses ansible, in a pipenv, in a WSL 2 Ubuntu instance to provision locally.
Intended to be re-runnable (idempotent) to maintain and update when required.
- Windows 10.
- WSL 2
- Ubuntu 20.04 installed via Windows Store.
sudo apt-get update
sudo apt install --yes python3-pipsudo pip3 install pipenv
git clone git@github.com:neilkidd/provision-ubuntu2004-on-wsl2.gitcd provision-ubuntu2004-on-wsl2pipenv install --devpipenv shellansible-galaxy install -r requirements.yml --forceansible-playbook playbook.yml -i inventory --ask-become-pass- Profit 😄
- See the playbook.yml task:
Install apt cmd line appsfor apt packages - yarn
- tfenv
- aws vault
- rbenv
| Description | Command |
|---|---|
| Find all local info | ansible localhost -m setup |
| Run only rbenv | ansible-playbook playbook.yml -i inventory --ask-become-pass --tags "rbenv" |
| Purge deps | pipenv uninstall --all |
See vars.yml to configure which tasks get run.