我用安装在CD上的用户数据和元数据配置了我的Ubuntu 20.04.1打包程序模板部署,但是我不知道如何配置autoinstall引导命令来使subiquity部分工作:
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>"
]
用户数据
#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"
我终于可以部署一些基本安装的vSphere Ubuntu模板了。我没有找到太多关于这个东西的文档,所以如果你能帮我解决这个问题,那就太好了。
格雷兹。
发布于 2020-12-19 10:51:32
我使用的是packer设置的默认HTTP源,而不是CD,但boot_command应该是类似的。
来自Automating Ubuntu 20.04 installs with Packer
"boot_command": [
"<enter><enter><f6><esc><wait> ",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<enter>"
]
如果您想使用CD,那么这部分的惟一区别应该是cloud-config的源文件。
我在Ubuntu20.04和subiquity安装器上安装了一个可以正常工作的包装器,还在等待boxcutter/ubuntu github repo上的PR。你可以参考这个来寻求帮助。我也花了一段时间才弄明白。
https://stackoverflow.com/questions/65342157
复制相似问题