Ansible role: dagos.wsl_conf

CI Release

A role for configuring WSL specific configuration.

Requirements

None.

Role variables

The following variables are overridable by users to configure this role:

---
########################################
# Variables for /etc/wsl.conf
# Follow link for more information:
#   https://docs.microsoft.com/en-us/windows/wsl/wsl-config#set-wsl-launch-settings
wsl_conf_automount_enabled: "true"
wsl_conf_automount_mountFsTab: "true"
wsl_conf_automount_root: "/mnt/"
wsl_conf_automount_options: "metadata,umask=22,fmask=11"
wsl_conf_network_generateHosts: "true"
wsl_conf_network_generateResolvConf: "true"
wsl_conf_interop_enabled: "true"
wsl_conf_interop_appendWindowsPath: "false"
wsl_conf_user_default: ""
wsl_conf_boot_command: ""
########################################

Dependencies

None.

Example playbook

The following playbook is tested regularly as part of the defined CI pipeline:

---
- name: Converge
  hosts: all
  pre_tasks:
    # By becoming this user when running the role, we test that
    # the executing user is used as a default when configuring
    # the /etc/wsl.conf file.
    - name: Create a test user
      ansible.builtin.user:
        name: test_user
        state: present
  roles:
    - role: dagos.wsl_conf
      become: true
      become_user: test_user
      vars:
        wsl_conf_network_generateHosts: "false"

License

MIT

Author information

This role was created in 2022 by Lucas Resch.