[](<https://github.com/elhub/devxp-ansible-collection-wsl)
[
](https://teamcity.elhub.cloud/buildConfiguration/)
- Table of Contents
- Breaking changes for Ubuntu 24.04 and devxp-wsl
- About
- Getting Started
- Usage
- Testing
- Contributing
- Owners
- License
Warning
This collection has gotten some breaking changes due to the move
from Ubuntu 22.04 to Ubuntu 24.04 and devxp-linux
/plat-intune-wsl
to devxp-wsl
.
If you are on Ubuntu 22.04, use the ubuntu22
branch.
This ansible collection comprises resources that facilitate an opinionated setup of the Linux/WSL components for a a Windows developer workstation at Elhub.
The ansible collection contains:
- The base role. This bootstraps core packages, creates base directories, and sets up ssh-agent
- Roles for setting up common tools such as git, docker, molecule
- Roles for setting up development environments for different programming languages/purposes such as ansible, java, and kotlin, and node/javascript, and python.
- Roles for setting up scripts and apps used by the development team such as git utils, and adr.
Requires:
- WSL2 with the Ubuntu linux distribution.
- Ansible installed in the linux installation
To install the collection from git, use the following in your requirements.yml
---
collections:
- name: [email protected]:elhub/devxp-ansible-collection-wsl.git
type: git
version: main
You can also install manually by using the following ansible-galaxy command
ansible-galaxy collection install git+https://github.com/elhub/devxp-ansible-collection-wsl
The roles in this playbook are shared by the ansible playbooks used to set up the developer PC's; see e.g., devxp-linux.
The base role is used to bootstrap the environment for the other roles.
- base role: See the documentation here
For details and examples for the other individual roles:
- adr role: See the documentation here
- ansible role: See the documentation here
- docker role: See the documentation here
- git role: See the documentation here
- git_utils role: See the documentation here
- java role: See the documentation here
- kotlin role: See the documentation here
- molecule role: See the documentation here
- node role: See the documentation here
- python role: See the documentation here
- mise role: See documentation here
Install the collection using the instructions above.
You can run the roles from the command line using the following command.
Replace elhub.wsl.restish
with the role you want to run.
ansible -m import_role -e "{ 'ansible_env' : { 'HOME' : '$HOME' }}" -a name=elhub.wsl.restish localhost
If the role requires sudo/root, add --ask-become-pass
to the command.
The roles can be tested using molecule. Ensure you have python, ansible, docker, and molecule installed (the roles in this collection should ensure that your environment is set up correctly) and a docker backend running. Then change to the role you wish to validate and run:
molecule test
While molecule is great for "unit testing", it can be desirable to test new things in a 'test environment', before adding these roles to a playbook that sets up your main workstation. For this we build a minimal Docker image which can then used to create container and validate things work as expected.
To build the image run: docker build -f test/Dockerfile -t wsl-test:latest .
You might want to install only certain roles from this collection, or maybe set some specific vars for any given role. In this case modify the test.yml accordingly before building the image.
Then you can ssh into the container with docker run -it wsl-test:latest
and test things out before you install them on your main system.
Contributing, issues and feature requests are welcome. See the Contributing file.
This project is developed by Elhub. For the specific development group responsible for this code, see the Codeowners file.
This project is MIT licensed.