-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-data
56 lines (52 loc) · 1.68 KB
/
user-data
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
#cloud-config
autoinstall:
# https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html
version: 1
network:
# https://netplan.readthedocs.io/en/latest/netplan-yaml/
version: 2
ethernets:
eth0:
match:
driver: [
"e1000e", # Q956 (Intel I219-LM)
"r816*", # Q556 (Realtek RTL8111GN)
]
set-name: eth0
wakeonlan: true
dhcp4: yes
dhcp4-overrides:
use-dns: false
use-domains: false
nameservers:
addresses: [192.168.1.1]
search: [home]
ssh:
install-server: true
allow-pw: false
user-data:
disable_root: true
timezone: Europe/Berlin
package_upgrade: false
users:
- name: admin
groups: sudo
lock_passwd: true
shell: /bin/bash
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYLx7VS8zBK3d0d7fle8+T5qzKaS9vEYfDyaShx0phF admin"
sudo: ALL=(ALL) NOPASSWD:ALL
- name: ansible
groups: sudo
lock_passwd: true
shell: /bin/bash
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfqnqPPeq8jseq2tXxOl2KNiASOB+YJ3r3e9UDNMgCl ansible"
sudo: ALL=(ALL) NOPASSWD:ALL
late-commands:
# generate random hostname
- echo ubuntu-host-$(openssl rand -hex 3) > /target/etc/hostname
# show IP at login screen (static)
- echo "Ubuntu 24.04 LTS \nIP - $(hostname -I)\n" > /target/etc/issue
- curtin in-target --target=/target -- lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
- curtin in-target --target=/target -- resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv