Skip to content

Commit

Permalink
Update WSL datasource documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Apr 1, 2024
1 parent 352bad9 commit bf210e5
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions doc/rtd/reference/datasources/wsl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,25 @@ User data can be supplied in any
:ref:`format supported by cloud-init<user_data_formats>`, such as YAML
cloud-config files or shell scripts. At runtime, the WSL datasource looks for
user data in the following locations inside the Windows host filesystem, in the
order specified below:
order specified below.

First, configurations from Ubuntu Pro/Landscape are checked for in the
following paths:

1. ``%USERPROFILE%\.ubuntupro\.cloud-init\<InstanceName>.user-data`` holds data
provided by Landscape to configure a specific WSL instance. If this file
is present, normal user-provided configurations are not looked for. This
file is merged with (2) on a per-module basis. If this file is not present,
then the first user-provided configuration will be used in its place.

2. ``%USERPROFILE%\.ubuntupro\.cloud-init\agent.yaml`` holds data provided by
the Ubuntu Pro for WSL agent. If this file is present, it's modules will be
merged with (1), overriding any conflicting modules. If (1) is not provided,
then this file will be merged with any valid user-provided configuration
instead.

Then, if a file from (1) is not found, a user-provided configuration will be
looked for instead in the following order:

1. ``%USERPROFILE%\.cloud-init\<InstanceName>.user-data`` holds user data for a
specific instance configuration. The datasource resolves the name attributed
Expand Down Expand Up @@ -82,7 +100,8 @@ Only the first match is loaded, and no config merging is done, even in the
presence of errors. That avoids unexpected behaviour due to surprising merge
scenarios. Also, notice that the file name casing is irrelevant since both the
Windows file names, as well as the WSL distro names, are case-insensitive by
default. If none are found, cloud-init remains disabled.
default. If none are found, cloud-init remains disabled if no other
configurations from previous steps were found.

.. note::
Some users may have configured case sensitivity for file names on Windows.
Expand Down Expand Up @@ -205,4 +224,3 @@ include file.
WSL automatically generates those files by default, unless configured to
behave otherwise in ``/etc/wsl.conf``. Overwriting may work, but only
until the next reboot.

0 comments on commit bf210e5

Please sign in to comment.