I'm trying to troubleshoot an Ubuntu autoinstaller using cloud-init & autoinstall. Ideally I'm trying to have it encrypt & partition the main OS disk on a laptop after the installer runs. Everything in the following file is working, except for the Storage section, which I've copied over after running through the installer with Storage as interactive.
Here is the user-data file which I put together after reviewing a few different resources:
autoinstall:
version: 1
refresh-installer:
update: yes
channel: stable
interactive-sections:
- network
- identity
locale: en_US.UTF-8
keyboard:
layout: us
ssh:
allow-pw: false
install-server: false
storage:
config:
- grub_device: false
id: disk-nvme0n1
name: ''
path: /dev/nvme0n1
preserve: false
ptable: gpt
serial: KINGSTON SNVS1000G_50026B7784415179
type: disk
wipe: superblock
wwn: eui.00000000000000000026b77844151795
- device: disk-nvme0n1
flag: boot
grub_device: true
id: partition-0
number: 1
preserve: false
size: 536870912
type: partition
wipe: superblock
- fstype: fat32
id: format-0
preserve: false
type: format
volume: partition-0
- device: disk-nvme0n1
flag: ''
grub_device: false
id: partition-1
number: 2
preserve: false
size: 1073741824
type: partition
wipe: superblock
- fstype: ext4
id: format-1
preserve: false
type: format
volume: partition-1
- device: disk-nvme0n1
flag: ''
grub_device: false
id: partition-2
number: 3
preserve: false
size: 998591430656
type: partition
wipe: superblock
- id: dm_crypt-0
keyfile: /tmp/luks-key-em_r7gfw
preserve: false
type: dm_crypt
volume: partition-2
- devices:
- dm_crypt-0
id: lvm_volgroup-0
name: ubuntu-vg
preserve: false
type: lvm_volgroup
- id: lvm_partition-0
name: ubuntu-lv
preserve: false
size: 107374182400B
type: lvm_partition
volgroup: lvm_volgroup-0
wipe: superblock
- fstype: ext4
id: format-2
preserve: false
type: format
volume: lvm_partition-0
- device: format-2
id: mount-2
path: /
type: mount
- device: format-1
id: mount-1
path: /boot
type: mount
- device: format-0
id: mount-0
path: /boot/efi
type: mount
version: 1
apt:
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://us.archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
conf: |
APT {
Get {
Assume-Yes "true";
Fix-Broken "true";
};
};
sources:
ignored1:
source: ppa:graphics-drivers/ppa
snaps:
- name: slack
classic: true
channel: stable
packages:
- build-essential
- ubuntu-desktop
- dkms
- libgl1-mesa-glx
- libegl1-mesa
- libxcb-xtest0
- libxcb-xinerama0
- wormhole
- emacs
- git
- libreoffice
- pavucontrol
- clamav
- clamtk
- clamav-daemon
- clamav-docs
- google-chrome-stable
- chromium-codecs-ffmpeg-extra
- bluez-btsco
- bluez-dbg
- bluez-hcidump
- bluez-tools
- libbluetooth3-dbg
- dirmngr
- gnupg
- apt-transport-https
- ca-certificates
- software-properties-common
- sublime-text
package_update: true
package_upgrade: true
late-commands:
- find /target/etc/netplan/ -name "*.yaml" -exec sh -c 'mv "$1" "$1-orig"' _ {} \;
- |
cat <<EOF | sudo tee /target/etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: NetworkManager
EOF
- curtin in-target --target /target netplan generate
- curtin in-target --target /target netplan apply
- curtin in-target --target /target systemctl enable NetworkManager.service
user-data:
runcmd:
- [ apt-get, update ]
- [ apt-get, dist-upgrade, --yes ]
- [ apt, install, --assume-yes, google-chrome-stable ]
- [ mkdir, -p, /run/post-install/ ]
- [ wget, "https://zoom.us/client/latest/zoom_amd64.deb", -O, /run/post-install/zoom_amd64.deb]
- [ dpkg, -i, /run/post-install/zoom_amd64.deb ]
- [ apt, --fix-broken, --assume-yes, install ]
- apt-get --assume-yes purge firefox thunderbird byobu
- apt autoremove --assume-yes
- apt update
- apt install --assume-yes sublime-text
- gsettings set org.gnome.shell favorite-apps "$(gsettings get org.gnome.shell favorite-apps | sed s/.$//), 'google-chrome.desktop', 'sublime_text.desktop']"
- gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
I've tried commenting out the "serial" section in Storage to see if that would make a change, but even copying the output from the curtin-install-cfg.yaml for the Storage section doesn't seem to work.
I found this bug report that seems to imply something simpler may come in the future but isn't here yet: https://bugs.launchpad.net/subiquity/+bug/1913986
Referenced the following in building this out:
The PGP keys for Chrome & Sublime-Text have been omitted due to length but they're working. Just can't get the storage setup!
Any guidance is appreciated!