Several config keys are lists of commands to be executed. Each command can be a string (in which case it is executed via "sh -c") or a list, in which case it is executed directly. Any command exiting with a non-zero return code is considered an error and aborts the install (except for error-commands, where it is ignored).
Would stop on the network screen and allow the user to change the defaults. If a value is provided for an interactive section it is used as the default.
You can use the special section name of "\*" to indicate that the installer should ask all the usual questions -- in this case, the `autoinstall.yaml` file is not really an "autoinstall" file at all, instead just a way to change the defaults in the UI.
A list of shell commands to invoke as soon as the installer starts, in particular before probing for block and network devices. The autoinstall config is available at `/autoinstall.yaml` (irrespective of how it was provided) and the file will be re-read after the `early-commands` have run to allow them to alter the config if necessary.
The layout of any attached keyboard. Often systems being automatically installed will not have a keyboard at all in which case the value used here does not matter.
The mapping's keys correspond to settings in the `/etc/default/keyboard` configuration file. See [its manual page](http://manpages.ubuntu.com/manpages/bionic/en/man5/keyboard.5.html) for more details.
Corresponds to the value of `grp:` option from the `XKBOPTIONS` setting. Acceptable values are (but note that the installer does not validate these): `caps_toggle`, `toggle`, `rctrl_toggle`, `rshift_toggle`, `rwin_toggle`, `menu_toggle`, `alt_shift_toggle`, `ctrl_shift_toggle`, `ctrl_alt_toggle`, `alt_caps_toggle`, `lctrl_lshift_toggle`, `lalt_toggle`, `lctrl_toggle`, `lshift_toggle`, `lwin_toggle`, `sclk_toggle`
[Netplan-formatted](https://netplan.io/reference) network configuration. This will be applied during installation as well as in the installed system. The default is to interpret the config for the install media, which runs DHCPv4 on any interface with a name matching "eth\*" or "en\*" but then disables any interface that does not receive an address.
This section historically used the same format as curtin, [which is documented here](https://curtin.readthedocs.io/en/latest/topics/apt_source.html). Nonetheless, some key differences with the format supported by curtin have been introduced:
* Subiquity supports an alternative format for the `primary` section, allowing to configure a list of candidate primary mirrors. During installation, subiquity will automatically test the specified mirrors and select the first one that seems usable. This new behavior is only activated when the `primary` section is wrapped in the `mirror-selection` section.
if the `primary` section is contained within the `mirror-selection` section, the automatic mirror selection is enabled. This is the default in new installations.
#### primary (when placed inside the `mirror-selection` section):
**type:** custom, see below
In the new format, the `primary` section expects a list of mirrors, which can be expressed in two different ways:
* the special value `country-mirror`
* a mapping with the following keys:
*`uri`: the URI of the mirror to use, e.g., "http://fr.archive.ubuntu.com/ubuntu"
*`arches`: an optional list of architectures supported by the mirror. By default, this list contains the current CPU architecture.
If geoip is true and one of the candidate primary mirrors has the special value `country-mirror`, a request is made to `https://geoip.ubuntu.com/lookup`. Subiquity then sets the mirror URI to `http://CC.archive.ubuntu.com/ubuntu` (or similar for ports) where `CC` is the country code returned by the lookup. If this section is not interactive, the request is timed out after 10 seconds.
If the legacy behavior (i.e., without mirror-selection) is in use, the geoip request is made if the mirror to be used is the default, and its URI ends up getting replaced by the proper country mirror URI.
Storage configuration is a complex topic and the description of the desired configuration in the autoinstall file can also be complex. The installer supports "layouts", simple ways of expressing common configurations.
The lvm layout will, by default, attempt to leave room for snapshots and further expansion. A sizing-policy key may be supplied to control this behavior.
**type:** string (enumeration)
**default:** scaled
Supported values are:
*`scaled` -> adjust space allocated to the root LV based on space available to the VG
*`all` -> allocate all remaining VG space to the root LV
The scaling system is currently as follows:
* Less than 10 GiB: use all remaining space for root filesystem
* Between 10-20 GiB: 10 GiB root filesystem
* Between 20-200 GiB: use half of remaining space for root filesystem
For full flexibility, the installer allows storage configuration to be done using a syntax which is a superset of that supported by curtin, described at https://curtin.readthedocs.io/en/latest/topics/storage.html.
If the "layout" feature is used to configure the disks, the "config" section will not be used.
As well as putting the list of actions under the 'config' key, the [grub](https://curtin.readthedocs.io/en/latest/topics/config.html#grub) and [swap](https://curtin.readthedocs.io/en/latest/topics/config.html#swap) curtin config items can be put here. So a storage section might look like:
Curtin supported identifying disks by serial (e.g. `Crucial_CT512MX100SSD1_14250C57FECE`) or by path (e.g. `/dev/sdc`) and the server installer supports this as well. The installer additionally supports a ''match spec'' on a disk action that supports more flexible matching.
The actions in the storage config are processed in the order they are in the autoinstall file. Any disk action is assigned a matching disk -- chosen arbitrarily from the set of unassigned disks if there is more than one, and causing the installation to fail if there is no unassigned matching disk.
A match spec supports the following keys:
*`model: foo`: matches a disk where ID_VENDOR=foo in udev, supporting globbing
*`path: foo`: matches a disk based on path (e.g. `/dev/sdc`), supporting globbing (the globbing support distinguishes this from specifying path: foo directly in the disk action)
*`serial: foo`: matches a disk where ID_SERIAL=foo in udev, supporting globbing (the globbing support distinguishes this from specifying serial: foo directly in the disk action)
*`ssd: yes|no`: matches a disk that is or is not an SSD (vs a rotating drive)
*`size: largest|smallest`: take the largest or smallest disk rather than an arbitrary one if there are multiple matches (support for `smallest` added in version 20.06.1)
A special sort of key is `install-media: yes`, which will take the disk the installer was loaded from (the `ssd` and `size` selectors will never return this disk). If installing to the install media, care obviously needs to be take to not overwrite the installer itself!
* For the last partition specified for a particular device, you can specify the size as "-1" to indicate that the partition should fill the remaining space.
Configure the initial user for the system. This is the only config key that must be present (unless the [user-data section](#user-data) is present, in which case it is optional).
A mapping that can contain keys, all of which take string values:
#### realname
The real name for the user. This field is optional.
The crypted password string must conform to what [passwd](https://manpages.ubuntu.com/manpages/jammy/en/man1/passwd.1.html) expects. Depending on the special characters in the password hash, quoting may be required, so it's safest to just always include the quotes around the hash.
Several tools can generate the crypted password, such as `mkpasswd` from the `whois` package, or `openssl passwd`.
A list of snaps to install. Each snap is represented as a mapping with required `name` and optional `channel` (defaulting to `stable`) and classic (defaulting to `false`) keys. For example:
A list of packages to install into the target system. More precisely, a list of strings to pass to "`apt-get install`", so this includes things like task selection (`dns-server^`) and installing particular versions of a package (`my-package=1-1`).
Shell commands to run after the install has completed successfully and any updates and packages installed, just before the system reboots. They are run in the installer environment with the installed system mounted at `/target`. You can run `curtin in-target -- $shell_command` (with the version of subiquity released with 20.04 GA you need to specify this as `curtin in-target --target=/target -- $shell_command`) to run in the target system (similar to how plain `in-target` can be used in `d-i preseed/late_command`).
Shell commands to run after the install has failed. They are run in the installer environment, and the target system (or as much of it as the installer managed to configure) will be mounted at /target. Logs will be available at `/var/log/installer` in the live session.
**default:** `type: print` which causes output on tty1 and any configured serial consoles
**can be interactive:** no
The installer supports reporting progress to a variety of destinations. Note that this section is ignored if there are any [interactive sections](#interactive-sections); it only applies to fully automated installs.
The config, and indeed the implementation, is 90% the same as [that used by curtin](https://curtin.readthedocs.io/en/latest/topics/reporting.html).
Each key in the `reporting` mapping in the config defines a destination, where the `type` sub-key is one of:
**The rsyslog reporter does not yet exist**
* **print**: print progress information on tty1 and any configured serial console. There is no other configuration.
* **rsyslog**: report progress via rsyslog. The **destination** key specifies where to send output.
* **webhook**: report progress via POSTing JSON reports to a URL. Accepts the same configuration as [curtin](https://curtin.readthedocs.io/en/latest/topics/reporting.html#webhook-reporter).
* **none**: do not report progress. Only useful to inhibit the default output.
Provide cloud-init user data which will be merged with the user data the installer produces. If you supply this, you don't need to supply an [identity section](#identity) (but then it's your responsibility to make sure that you can log into the installed system!).