Created
January 27, 2021 18:47
-
-
Save zhouqt/00c20af96b808752ceaa95a4ee0b76ea to your computer and use it in GitHub Desktop.
ubuntu subiquity autoinstall user-data example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
autoinstall: | |
version: 1 | |
early-commands: | |
- snap set system proxy.http="http://192.168.122.1:12345" | |
- snap set system proxy.https="http://192.168.122.1:12345" | |
locale: en_US | |
keyboard: | |
layout: en | |
variant: us | |
network: | |
network: | |
version: 2 | |
ethernets: | |
enp1s0: | |
dhcp4: yes | |
apt: | |
# even set to no/false, geoip lookup still happens | |
geoip: false | |
primary: | |
- arches: [default] | |
uri: "http://mirrors.aliyun.com/ubuntu/" | |
storage: | |
layout: | |
name: lvm | |
refresh-installer: | |
channel: edge | |
update: yes | |
identity: | |
hostname: server | |
# User creation doesn't work on ubuntu 20.04 cdrom, when using seed iso/disk datasource, but nocloud-net works. | |
# https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1879485 | |
username: test1 | |
password: "$6$An3m6PIeRT.rNozT$kk8h3G8NOtllb18pq0iEa5a/T.6CEkR.Ta6uINh66HcS7YebUMkLVXaY5fGov1aWWt0ZFgyY.6fqrtNBDuEJt1" | |
ssh: | |
install-server: yes | |
allow-pw: yes | |
late-commands: | |
# From https://stackoverflow.com/a/61844775 | |
- useradd -m -R /target -u 1001 test1 | |
- echo "test1:ubuntu" | chroot /target /usr/sbin/chpasswd | |
- usermod -R /target -aG sudo test1 | |
# Pause for debug. | |
- mkfifo /tmp/fifo1; read < /tmp/fifo1; pwd | |
user-data: | |
disable_root: false | |
# Below setting doesn't work now. | |
users: | |
- default | |
- name: test1 | |
passwd: "$6$An3m6PIeRT.rNozT$kk8h3G8NOtllb18pq0iEa5a/T.6CEkR.Ta6uINh66HcS7YebUMkLVXaY5fGov1aWWt0ZFgyY.6fqrtNBDuEJt1" | |
lock_passwd: false | |
ssh_import_id: gh:zhouqt | |
ssh_pwauth: True | |
chpasswd: { expire: False } | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
groups: users, admin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下面是我整理的自动化安装Ubuntu22.04 LTS 桌面版本,我希望可以帮助到有需要的人:
The following is the automated installation of Ubuntu22.04 LTS Desktop version that I compiled. I hope it can help those in need:
####################################################################################################
#cloud-config
autoinstall:
refresh-installer:
update: yes
apt:
disable_components: []
fallback: abort
geoip: false
mirror-selection:
primary:
- country-mirror
- arches: &id001
- amd64
- i386
uri: http://172.17.80.238/ubuntu/
- arches: &id002
- arm64
uri: http://ports.ubuntu.com/ubuntu-ports
preserve_sources_list: false
security:
- arches: id001
uri: http://172.17.80.238/ubuntu/
- arches: id002
uri: http://ports.ubuntu.com/ubuntu-ports
codecs:
install: false
drivers:
install: true
refresh-installer:
channel: edge
update: yes
storage:
layout:
name: lvm
# password: secret
sizing-policy: all
user-data:
disable_root: false
chpasswd:
expire: false
list:
- root:$6$jMIpAD1dGkm6sqfJ$HF6uWZp3lbYMjyI3jWUE1j51R9sqCkX8tjrp3xut2AWs3r2Ou9JGyZu1Xr7D3VF3B4X2gYCfjQatKoxAbDGSu0
identity:
realname: ''
hostname: ubuntu
username: ubuntu
# password is xxxxxx
password: '$6$jMIpAD1dGkm6sqfJ$HF6uWZp3lbYMjyI3jWUE1j51R9sqCkX8tjrp3xut2AWs3r2Ou9JGyZu1Xr7D3VF3B4X2gYCfjQatKoxAbDGSu0'
kernel:
package: linux-generic-hwe-22.04
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
version: 2
ethernets:
ens33:
match:
name: "en"
dhcp4: true
eth1:
match:
name: "eth"
dhcp4: true
oem:
install: auto
snaps:
classic: true
name: powershell
source:
id: ubuntu-server
search_drivers: true
ssh:
allow-pw: true
authorized-keys: []
install-server: true
updates: security
timezone: Asia/Shanghai
late-commands:
version: 1
###################################################################################################