I noticed, that adding a section below the field user-data does not have any effect.
Could you include an example in the documentation on how to e.g. add a user using the user-data section? This could be a user with e.g. an empty password, SSH-Access and sudo: ALL=(ALL) NOPASSWD:ALL settings.
Several tries using something like this failed (even though the yml is syntactically correct):
looks like you did not “add a section to user-data” but you instead added a new top-level object called “users” … yaml requires proper indentation of the blocks …
Thank you very much, that helped. The documentation should then maybe include your example and explicitly state, which section takes precedence:
If you supply this, your identity section is ignored and the users section is taken instead (but then it’s your responsibility to make sure that you can log into the installed system!).
The hostname must then be set also in the user-data section, instead of the identity section.
Thank you very much @kbrannen for your initial idea to get interactivity in this installer. I implemented this and it worked great but was not what I wanted. Today I remembered my firstboot script which I use to get around a gnome flaw and it is working wonderful:
How to get interactivity during autoinstall using whiptail
First create a script which contains your commands:
- |
cat <<'EOF' | tee -a /get_userdetails.sh
#Change to tty3 to display the dialog
if ! chvt 3 &>/dev/null; then
break
fi
export TERM=linux
export NCURSES_NO_UTF8_ACS=1
printf "\ec"
# Hostname dialog
default_hostname=focal-ai
custom_hostname=$(whiptail --inputbox "Please enter a Hostname:\n\nDefault: [$default_hostname]" 9 30 --clear --nocancel --ok-button "Enter" 3>&1 1>&2 2>&3)
if [[ -z $custom_hostname ]]; then
custom_hostname=$default_hostname
fi
sed -i 's/focal-autoinstall/'"$custom_hostname"'/' /autoinstall.yaml
#Change back to tty1
if ! chvt 1 &>/dev/null; then
break
fi
EOF
Then call the script the following way to block the installer from continuing:
- bash /get_userdetails.sh <> /dev/tty3 >&0 2>&1
Preinsert whatever you want to replace or however you want it:
# User section
user-data:
hostname: focal-autoinstall
Have fun with nice whiptail dialogs
EDIT: Not tested but might work for late-commands, too
While update is defined, it doesn’t look like updates is. This appears to only have the option of security (default) or all pertaining to which updates are ran post install. It may be worth defining the declaration. This was a fairly recent addition:
I’m trying to create minimal 22.04 installation . Is it possible to somehow remove packages during autoinstall? I was trying to use debconf-selections for this and skip some tasks:
The packages installed are not being selected, but come straight from the image included with the installer. With 22.04 there is a minimal image, but I’m not aware of any way to specify an image with autoinstall.
However, I did come up with this kludge to install the minimal image using autoinstall. I’ve gotten it to work with 22.04 ( subiquity 22.04.2).
Is it possible to pull the completed autoinstall.yaml from a system after you’ve filled out the interactive installer? (Before rebooting). Specifically the storage section on a complicated setup.
Also re storage mapping is there any easy way to match on satassd vs nvmessd
@itjamie The installed system will contain a copy of /var/log/installer/autoinstall-user-data. If you catch it before reboot, you can find the file as well in the same location in the installation environment.
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
“”"
It doesn’t seem to work for me. When I supply LUKS_PASSPHRASE the installer seems to hang, and sizing-policy is ignored - not sure where it should be placed.
Thing I’ve tried:
autoinstall:
storage:
layout:
name: lvm
password: secret
sizing-policy: all
I’ve tried it for Ubuntu 22.04.02 LTS, maybe these options only work for 23? If so, how can I check?
Hi @golebiewsky, thanks for trying out the new stuff. I’m hoping to incorporate doc improvements including the relevant minimum version of Subiquity needed for a given autoinstall feature.
You’ll need a newer Subiquity than what’s in the 22.04.2 LTS ISO. If you’d like these features, please allow the Subiquity snap to refresh to version 23.04.2 (or later). This autoinstall snippet should do the job for refreshing the snap.
refresh-installer:
update: yes
Your autoinstall snippet should be correct. I ran a test locally like below and it works as expected.
the style of https://ubuntu.com/server/docs/install/autoinstall-reference makes it nearly impossible to know the structure of these. For instance, it isn’t obvious where in the storage section one would put a sizing-policy. Please change the style of the page so the structure of the config is clear.
One more question: the docs troubleshooting aren’t useful. As far as I can tell, the default reporting config already prints all of the existing logs - is this correct? Maybe there’s some way to get a shell on another tty to see what’s happening?