{"id":13342530,"url":"https://github.com/belgotux/ansible-role-wsl","last_synced_at":"2025-03-12T01:37:32.651Z","repository":{"id":57894470,"uuid":"527746718","full_name":"belgotux/ansible-role-wsl","owner":"belgotux","description":"Role to add all the necessary to use wsl correctly : configure global git, ssh keys with keychain at login, install minimal required tools, no password for sudo, configure ansible, docker-compose ans aliases if docker desktop is installed on windows","archived":false,"fork":false,"pushed_at":"2025-02-04T07:08:20.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T08:19:37.205Z","etag":null,"topics":["ansible","wsl"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/belgotux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-22T22:07:37.000Z","updated_at":"2025-02-04T07:08:24.000Z","dependencies_parsed_at":"2025-01-27T17:32:05.307Z","dependency_job_id":null,"html_url":"https://github.com/belgotux/ansible-role-wsl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgotux%2Fansible-role-wsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgotux%2Fansible-role-wsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgotux%2Fansible-role-wsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgotux%2Fansible-role-wsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/belgotux","download_url":"https://codeload.github.com/belgotux/ansible-role-wsl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243141286,"owners_count":20242815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","wsl"],"created_at":"2024-07-29T19:29:30.504Z","updated_at":"2025-03-12T01:37:32.633Z","avatar_url":"https://github.com/belgotux.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"WSL\n=========\n\nRole to add all the necessary to use wsl correctly : configure global git, configure ssh keys with keychain at login, install minimal required tools, no password for sudo, configure ansible, docker-compose ans aliases if docker desktop is installed on windows\n\nRequirements\n------------\n- Install Ubuntu via wsl : `wsl --install -d ubuntu`\n- Put a username and password\n- Install Ansible on the fresh WSL : `sudo apt update \u0026\u0026 sudo apt install ansible -y`\n- Copy the archive or get it directly from ansible-galaxy : `ansible-galaxy install belgotux.wsl`\n- Copy the example playbook\n- Run the playbook with sudo password ask : `ansible-playbook wsl.yml -K`\n\nRole Variables\n--------------\n\n### Needed : \n- `id_rsa_files` : list of ssh keys in the format : `[src_priv: \"/mnt/c/Users/$myuser/.ssh/id_rsa\", src_pub: \"/mnt/c/Users/$myuser/.ssh/id_rsa\", dest: \"~/.ssh/id_rsa\"]`\n- `collections_to_install` : list of the ansible collections to install (default `community.docker`)\n\n### Optionnel :\n- `links_list` : list of src en dest link to create, for link your personnel script to files folder in ansible for example, format list of src and dest.\n- `dns_server` : to set manual DNS server and not take the automatic dns 172.21.32.1\n- `my_hostname` : to set a hostname for the distribution\n- `dns_search_suffix` : set search DNS suffix\n\n### Automatic : \n- `myuser`: the user defined at installation (default `\"{{ ansible_env.HOME }}\"`)\n\nExample Playbook\n----------------\n\n```yml\n- hosts: localhost\n  vars:\n    myuser: belgotux\n    git_global: \n    - param1: user\n      param2: name\n      value: \"belgotux\"\n    - param1: user\n      param2: email\n      value: \"belgotux@monlinux.net\"\n    - param1: init\n      param2: defaultBranch\n      value: \"main\"\n    - param1: core\n      param2: editor\n      value: \"code\"\n    - param1: credential\n      param2: helper\n      value: \"cache --timeout=57600\"\n    my_windows_user: \"{{myuser}}\"\n    bash_alias_dir_share: /usr/share\n    id_rsa_files:\n    - src_priv: \"/mnt/c/Users/belgotux/Nextcloud/keys/belgotux\"\n      src_pub: \"/mnt/c/Users/belgotux/Nextcloud/keys/belgotux.pub\"\n      dest: \"$HOME/.ssh/belgotux\"\n  connection: local\n  roles:\n    - name: wsl\n```\n\n\nLicense\n-------\n\n[GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html)\n\nAuthor Information\n------------------\n\nBelgotux\n[MonLinux](https://www.monlinux.net)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelgotux%2Fansible-role-wsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelgotux%2Fansible-role-wsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelgotux%2Fansible-role-wsl/lists"}