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 install --yes python3-pip
sudo pip3 install pipenv
git clone git@github.com:neilkidd/provision-ubuntu2004-on-wsl2.git
cd provision-ubuntu2004-on-wsl2
pipenv install --dev
pipenv shell
ansible-galaxy install -r requirements.yml
ansible-playbook playbook.yml -i inventory --ask-become-pass
- Profit 😄
- See the playbook.yml task:
Install apt cmd line apps
for 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.