-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubuntu-22.04-autoinstall.yml
63 lines (59 loc) · 1.77 KB
/
ubuntu-22.04-autoinstall.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#cloud-config
autoinstall:
version: 1
apt:
geoip: false
primary:
- arches: [default]
uri: https://mirrors.edge.kernel.org/ubuntu/
security:
- arches: [default]
uri: https://mirrors.edge.kernel.org/ubuntu/
identity:
username: vagrant
password: ${bcrypt("vagrant")}
hostname: ${hostname}
ssh:
install-server: yes
authorized-keys: ${format("%#v", compact(split("\n", file("${path.root}/keys/vagrant.pub"))))}
allow-pw: yes
packages:
- ubuntu-desktop
- qemu-guest-agent
- spice-vdagent
- spice-webdavd
- cloud-init
snaps:
- name: firefox
- name: gnome-3-38-2004
- name: gtk-common-themes
- name: snap-store
- name: snapd-desktop-integration
user-data:
users:
- name: vagrant
sudo: ALL=(ALL) NOPASSWD:ALL
- name: root
plain_text_passwd: vagrant
storage:
layout:
name: direct
early-commands:
- echo 'linux-generic-hwe-22.04' > /run/kernel-meta-package
late-commands:
# Enable the boot splash
- >-
sed -i /target/etc/default/grub -e
's/GRUB_CMDLINE_LINUX_DEFAULT=".*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/'
- curtin in-target -- update-grub
# Let NetworkManager handle network
- rm -f /target/etc/netplan/*
- >-
printf "network:\n version: 2\n renderer: NetworkManager"
> /target/etc/netplan/01-network-manager-all.yaml
- curtin in-target -- apt-get remove -y ubuntu-server ubuntu-server-minimal
# Keep cloud-init, as it performs some of the installation on first boot.
- curtin in-target -- apt-get install -y cloud-init
# Finally, remove things only installed as dependencies of other things
# we have already removed.
- curtin in-target -- apt-get autoremove -y