diff --git a/README.md b/README.md index 349efb7..802490b 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ ansible-playbook playbooks/.yml --ask-become-pass 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. +---- + To enable proper file permissions for Ansible on WSL, you need to configure the WSL automount settings. ```bash @@ -39,12 +41,6 @@ enabled = true options = "metadata,umask=022,fmask=0111" ``` -restart WSL: - -```bash -wsl --shutdown -``` - If you use a Network Drive, you have to mount it manually: ```bash @@ -64,10 +60,10 @@ Reload fstab: sudo mount -a ``` -Remove others write permissions: +Remove others write permissions in your project folder: ```bash -chmod -R o-w . +sudo chmod -R o-w . ``` ---- @@ -76,9 +72,7 @@ Install Ansible on WSL: ```bash sudo apt update -sudo apt install python3-pip pipx -sudo pipx install ansible -sudo apt install ssh-askpass +sudo apt install ansible ssh-askpass ``` Add SSH Keys from Windows to WSL: @@ -89,3 +83,9 @@ chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub ``` + +Lastly, restart WSL to apply the changes: + +```bash +sudo shutdown -r now +```