I configured my Ubuntu 20.04.1 Packer Template Deployment with user-data and meta-data mounted over CD, but I don’t know how to configure the autoinstall bootcommand to get the subiquity part working:
ubuntu-20.04.json
"cd_files": ["{{template_dir}}/ubuntu-20.04/meta-data", "{{template_dir}}/ubuntu-20.04/user-data"],
"cd_label": "cidata",
"iso_paths": [
"[ColoNord-ISOs] ISOs/ubuntu-20.04.1-live-server-amd64.iso"
],
"boot_wait": "5s",
"floppy_files": ["{{template_dir}}/preseed.cfg"],
"boot_command": [
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<wait><esc><wait><f6><wait><esc><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/casper/vmlinuz ",
"initrd=/casper/initrd ",
" ipv6.disable=1 autoinstall ",
"ds=nocloud-net;s=/cidata/",
"<enter>"
]
user-data
#cloud-config
autoinstall:
version: 1
early-commands:
#Stop SSH to prevent Packer from connecting too early
- sudo systemctl stop ssh
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://gb.archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
identity:
hostname: ubuntu2004
username: username
password: password
ssh:
allow-pw: true
install-server: true
locale: de_CH
keyboard:
layout: gb
network:
network:
version: 2
ethernets:
ens160:
addresses:
- 10.0.249.75/24
gateway4: 10.0.249.1
nameservers:
addresses:
- 10.10.10.10
- 10.10.10.11
- 10.10.10.12
- 10.10.10.13
search:
- domain.local
storage:
layout:
name: direct
config:
- type: disk
id: disk0
match:
size: largest
- type: partition
id: boot-partition
device: disk0
size: 500M
- type: partition
id: root-partition
device: disk0
size: -1
late-commands:
- "echo 'Defaults:username !requiretty' > /target/etc/sudoers.d/username"
- "echo 'username ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/username"
- "chmod 440 /target/etc/sudoers.d/username"
Would be awesome to get this working, so I can finally deploy some basic installed vSphere Ubuntu VM Templates.
I don’t find that much documentation about this stuff, so if you can handle me sth to get this solved would also be great.
Greez.