#cloud-config
autoinstall:
version: 1
locale: en_US
keyboard:
layout: us
variant: ''
# Identity settings
identity:
hostname: ubuntu-server
username: your_username
# gen password via mkpasswd -m sha-512
password: "$6$rounds=4096$<hashed_password_here>"
# Networking configuration
network:
version: 2
ethernets:
# ethernet connections
eth0:
# dhcp4: true
# optional: true
dhcp4: no
bridges:
br0:
interfaces: [eth0]
dhcp4: yes
# Storage configuration with ZFS mirror for root
storage:
layout:
name: custom
config:
- id: zpool
name: rpool
type: disk
children:
- type: zpool
name: rpool
layout: mirror
devices:
- match:
size: largest
path: DISK1 # Replace with the first device, e.g., /dev/sda
- match:
size: largest
path: DISK2 # Replace with the second device, e.g., /dev/sdb
pool_options: "ashift=12 autotrim=on acltype=posixacl compression=lz4 dnodesize=auto normalization=formD atime=off xattr=sa"
children:
- type: partition
size: -1 # Use the rest of the disk
children:
- type: zfs
name: bpool
mountpoint: /boot
properties:
mountpoint: legacy
compression: lz4
atime: off
- type: zfs
name: rpool/ROOT
mountpoint: /
properties:
mountpoint: legacy
compression: lz4
atime: off
# SSH Configuration
ssh:
install-server: true
allow-pw: true # Set to false for SSH key authentication
packages:
- openssh-server
# Unattended installation and updates
updates:
security: true
# User data to run post-install scripts
user-data:
disable_root: false
early-commands:
- curtin in-target --target=/target systemctl enable zfs-import-cache
late-commands:
- curtin in-target --target=/target apt-get update
what to change:
- identity: Configures the user information. Replace
hostname
,username
, andpassword
as needed. The password field should be hashed (e.g., viamkpasswd -m sha-512
). - network: Configures bridge
br0
DHCP foreth0
. Adjust as needed for your network settings. Useip link show
to identify. - disks: Configures
path
DISK1
andDISK2
to what you get viall /dev/disk/by-id/