我来自debian,现在正在尝试为Ubuntu20.04通用安装新服务器和VM建立一个环境,并且看到debian-installer (d-i)已被废弃,不再受支持,我已经开始处理自动安装和云-init,但仍然有一些斗争。
在安装服务器并从/var/log/installer复制安装文件并对其进行少量调整之后,我可以设置一个非常原始的系统,但这仍然缺少以下内容,可以轻松地处理d。
因此,到目前为止,我所做的是:使用Apache2设置tftp,这样我就可以提供PXE映像和云init用户数据。
cat /srv/tftp/pxelinux.cfg/defaultDEFAULT vesamenu.c32
TIMEOUT 100
ONTIMEOUT local
PROMPT 0
NOESCAPE 1
LABEL local
MENU DEFAULT
MENU LABEL boot-from-local-disk
LOCALBOOT 0
LABEL focal-live-install
MENU label Install focal
KERNEL vmlinuz
INITRD initrd
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://172.16.16.41/tftp/ubuntu-20.04.1-live-server-amd64.iso
LABEL focal-live-install-autoinstall
MENU label Install focal - autoinstall
KERNEL vmlinuz
INITRD initrd
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://172.16.16.41/tftp/ubuntu-20.04.1-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://172.16.16.41/tftp/cloud-init/cat /etc/apache2/conf-enabled/tftp.conf<Directory /srv/tftp>
Options +FollowSymLinks +Indexes
Require all granted
</Directory>
Alias /tftp /srv/tftpcat /srv/tftp/cloud-init/user-data#cloud-config
autoinstall:
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://de.archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
identity: {hostname: localhost, password: <>,
realname: ka_de_ae, username: ka_de_ae}
keyboard: {layout: de, toggle: null, variant: ''}
locale: en_GB
network:
ethernets:
enp3s0: {dhcp4: true}
version: 2
ssh:
allow-pw: true
authorized-keys: []
install-server: true
user-data:
disable_root: false
chpasswd:
root:<>
storage:
config:
- {ptable: gpt, path: /dev/sda, wipe: superblock-recursive, preserve: false, name: '', grub_device: true, type: disk, id: disk-sda}
- {device: disk-sda, size: 1048576, flag: bios_grub, number: 1, preserve: false,
grub_device: false, type: partition, id: partition-sda1}
- {device: disk-sda, size: 2147483648, wipe: superblock, flag: linux, number: 2,
preserve: false, grub_device: false, type: partition, id: partition-sda2}
- {fstype: ext4, volume: partition-sda2, preserve: false, type: format, id: format-0}
- {device: disk-sda, size: -1, wipe: superblock, flag: linux, number: 3,
preserve: false, grub_device: false, type: partition, id: partition-sda3}
- name: vg0
devices: [partition-sda3]
preserve: false
type: lvm_volgroup
id: lvm_volgroup-0
- {name: root, volgroup: lvm_volgroup-0, size: 5368709120B, preserve: false, type: lvm_partition,
id: lvm_partition-0}
- {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-1}
- {device: format-1, path: /, type: mount, id: mount-1}
- {name: swap, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false, type: lvm_partition,
id: lvm_partition-1}
- {fstype: swap, volume: lvm_partition-1, preserve: false, type: format, id: format-2}
- {device: format-2, path: '', type: mount, id: mount-2}
- {name: tmp, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false, type: lvm_partition,
id: lvm_partition-2}
- {fstype: ext4, volume: lvm_partition-2, preserve: false, type: format, id: format-3}
- {device: format-3, path: /tmp, type: mount, id: mount-3}
- {name: usr, volgroup: lvm_volgroup-0, size: 16106127360B, preserve: false, type: lvm_partition,
id: lvm_partition-3}
- {fstype: ext4, volume: lvm_partition-3, preserve: false, type: format, id: format-4}
- {device: format-4, path: /usr, type: mount, id: mount-4}
- {name: var, volgroup: lvm_volgroup-0, size: 10737418240B, preserve: false, type: lvm_partition,
id: lvm_partition-4}
- {fstype: ext4, volume: lvm_partition-4, preserve: false, type: format, id: format-5}
- {device: format-5, path: /var, type: mount, id: mount-5}
- {name: varlog, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false,
type: lvm_partition, id: lvm_partition-5}
- {fstype: ext4, volume: lvm_partition-5, preserve: false, type: format, id: format-6}
- {device: format-6, path: /var/log, type: mount, id: mount-6}
- {device: format-0, path: /boot, type: mount, id: mount-0}
swap: {swap: 0}
version: 1
users:
- name: ka_de_ae
shell: /bin/bash
ssh-authorized-keys:
- ssh-rsa <key + comment>
- ssh-rsa <key + comment>
- ssh-rsa <key + comment>
- ssh-rsa <key + comment>
runcmd:
- sed -i -e '/^#PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
- restart ssh这已经比最初的简单安装提前了一些步骤,但是有很多东西不起作用。
我想,从我所读到的,大部分这些事情应该是相当可行的,但我肯定错过了一些事情做的对,所以任何帮助都是值得感谢的。
发布于 2021-01-14 10:18:22
同时,对于一些要点,我找到了正确的语法。
对于HDD的LVM配置,我建议您从零开始手动安装一台服务器,并根据您的意愿配置磁盘,然后使用安装日志来正确处理磁盘部件。在我这么做之前,经过了几天的尝试和错误,我只是想知道,你不能像你想要的那样命名分区,更好地使用这些数字,系统会给它们命名,而不是任何其他的。执行此操作时,请将所有保留部分切换为false,并将最后一个分区的大小切换为-1以使用整个磁盘空间。
当前正在工作的用户-数据:
#cloud-config
autoinstall:
package_upgrade: true
packages:
- zsh
- tmux
- nmap
- curl
- wget
- git
- htop
- iperf
- fail2ban
- vim
- net-tools
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://de.archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
identity: {hostname: localhost, password: <password>,
username: ansible, realname: ansible}
keyboard: {layout: de, toggle: null, variant: ''}
locale: en_GB
ssh:
allow-pw: true
install-server: true
authorized-keys:
- ssh-rsa ...
- ssh-rsa ...
user-data:
disable_root: true
storage:
config:
- {ptable: gpt, path: /dev/sda, wipe: superblock-recursive, preserve: false, name: '', grub_device: true, type: disk, id: disk-sda}
- {device: disk-sda, size: 1048576, flag: bios_grub, number: 1, preserve: false,
grub_device: false, type: partition, id: partition-sda1}
- {device: disk-sda, size: 2147483648, wipe: superblock, flag: linux, number: 2,
preserve: false, grub_device: false, type: partition, id: partition-sda2}
- {fstype: ext4, volume: partition-sda2, preserve: false, type: format, id: format-0}
- {device: disk-sda, size: -1, wipe: superblock, flag: linux, number: 3,
preserve: false, grub_device: false, type: partition, id: partition-sda3}
- name: vg0
devices: [partition-sda3]
preserve: false
type: lvm_volgroup
id: lvm_volgroup-0
- {name: root, volgroup: lvm_volgroup-0, size: 5368709120B, preserve: false, type: lvm_partition,
id: lvm_partition-0}
- {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-1}
- {device: format-1, path: /, type: mount, id: mount-1}
- {name: swap, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false, type: lvm_partition,
id: lvm_partition-1}
- {fstype: swap, volume: lvm_partition-1, preserve: false, type: format, id: format-2}
- {device: format-2, path: '', type: mount, id: mount-2}
- {name: tmp, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false, type: lvm_partition,
id: lvm_partition-2}
- {fstype: ext4, volume: lvm_partition-2, preserve: false, type: format, id: format-3}
- {device: format-3, path: /tmp, type: mount, id: mount-3}
- {name: usr, volgroup: lvm_volgroup-0, size: 16106127360B, preserve: false, type: lvm_partition,
id: lvm_partition-3}
- {fstype: ext4, volume: lvm_partition-3, preserve: false, type: format, id: format-4}
- {device: format-4, path: /usr, type: mount, id: mount-4}
- {name: var, volgroup: lvm_volgroup-0, size: 10737418240B, preserve: false, type: lvm_partition,
id: lvm_partition-4}
- {fstype: ext4, volume: lvm_partition-4, preserve: false, type: format, id: format-5}
- {device: format-5, path: /var, type: mount, id: mount-5}
- {name: varlog, volgroup: lvm_volgroup-0, size: 4294967296B, preserve: false,
type: lvm_partition, id: lvm_partition-5}
- {fstype: ext4, volume: lvm_partition-5, preserve: false, type: format, id: format-6}
- {device: format-6, path: /var/log, type: mount, id: mount-6}
- {device: format-0, path: /boot, type: mount, id: mount-0}
swap: {swap: 0}
version: 1
late-commands:
- echo 'ansible ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ansiblehttps://askubuntu.com/questions/1307054
复制相似问题