This README.md provides some useful tips for enhancing the autoinstall process.
The following must be added to autoinstall.yaml (root node) to provide system user
based settings.
user-data:
users:
- name: user1
groups: sudo, users, admin
- name: user2
groups: users
late-commands:
- usermod -a -G docker user2In multi NIC setup environments it is also advisable to configure the netplan networking
inside autoinstall.yaml.
For a single network interface with DHCP:
network:
ethernets:
eth0:
dhcp4: yes
version: 2For environments with multiple network interfaces, you can configure them individually:
network:
version: 2
renderer: networkd
ethernets:
eth0:
match:
macaddress: "52:54:00:12:34:56"
set-name: eth0
dhcp4: yes
dhcp6: no
mtu: 1500
eth1:
match:
macaddress: "52:54:00:12:34:57"
set-name: eth1
addresses:
- 192.168.1.10/24
routes:
- to: 192.168.1.0/24
via: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
eth2:
match:
macaddress: "52:54:00:12:34:58"
set-name: eth2
addresses:
- 10.0.0.10/24
dhcp4: noThis configuration demonstrates:
- eth0: DHCP configuration with custom MTU
- eth1: Static IP with custom routes and DNS servers
- eth2: Static IP without DHCP
To generate a password hash for the identity.password field, use:
mkpasswd --method=yescryptThis will prompt you for a password and generate a yescrypt hash compatible with modern Ubuntu systems.
Before deploying, validate your autoinstall.yaml syntax:
# Check YAML syntax
yamllint autoinstall.yaml
# Or use Python to validate
python3 -c "import yaml; yaml.safe_load(open('autoinstall.yaml'))"To find MAC addresses for your network interfaces before installation:
ip link showOr from a running system:
ip addr | grep etherIf the autoinstall process fails:
- Press Ctrl+Alt+F2 during installation to access a debug shell
- Check logs in
/var/log/installer/ - Review the autoinstall configuration:
cat /autoinstall.yaml - Verify network connectivity:
ping -c 3 8.8.8.8
Use late-commands for post-installation tasks:
late-commands:
- curtin in-target --target=/target -- apt-get update
- curtin in-target --target=/target -- apt-get upgrade -y
- curtin in-target --target=/target -- systemctl enable ssh
- echo "Installation completed at $(date)" > /target/var/log/autoinstall-completion.logTo ensure consistent network interface naming:
- Use MAC address matching with
match.macaddress - Specify the desired name with
set-name - This prevents interface names from changing between reboots
For custom storage layouts, refer to Ubuntu's autoinstall documentation. The default direct layout is suitable for most single-disk installations. For complex setups (RAID, LVM, encryption), consider using the lvm or custom storage configuration.