Updated WSL Setup Instructions

This commit is contained in:
2026-02-01 13:26:28 +01:00
parent 37f9110b3a
commit c3c44f0bf9

View File

@@ -25,6 +25,8 @@ ansible-playbook playbooks/<playbook_name>.yml --ask-become-pass
To use Ansible on Windows, you need to set up Windows Subsystem for Linux (WSL). To use Ansible on Windows, you need to set up Windows Subsystem for Linux (WSL).
You then have the option to open a local Folder in VSCode and open a WSL terminal that points to the same folder under WSL. You then have the option to open a local Folder in VSCode and open a WSL terminal that points to the same folder under WSL.
----
To enable proper file permissions for Ansible on WSL, you need to configure the WSL automount settings. To enable proper file permissions for Ansible on WSL, you need to configure the WSL automount settings.
```bash ```bash
@@ -39,12 +41,6 @@ enabled = true
options = "metadata,umask=022,fmask=0111" options = "metadata,umask=022,fmask=0111"
``` ```
restart WSL:
```bash
wsl --shutdown
```
If you use a Network Drive, you have to mount it manually: If you use a Network Drive, you have to mount it manually:
```bash ```bash
@@ -64,10 +60,10 @@ Reload fstab:
sudo mount -a sudo mount -a
``` ```
Remove others write permissions: Remove others write permissions in your project folder:
```bash ```bash
chmod -R o-w . sudo chmod -R o-w .
``` ```
---- ----
@@ -76,9 +72,7 @@ Install Ansible on WSL:
```bash ```bash
sudo apt update sudo apt update
sudo apt install python3-pip pipx sudo apt install ansible ssh-askpass
sudo pipx install ansible
sudo apt install ssh-askpass
``` ```
Add SSH Keys from Windows to WSL: Add SSH Keys from Windows to WSL:
@@ -89,3 +83,9 @@ chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub chmod 644 ~/.ssh/id_rsa.pub
``` ```
Lastly, restart WSL to apply the changes:
```bash
sudo shutdown -r now
```