forked from lefeck/ubuntu-autoinstall-generator-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user-data-kvm-nvme-hardware.yml
224 lines (224 loc) · 5.46 KB
/
user-data-kvm-nvme-hardware.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#cloud-config
autoinstall:
apt:
disable_components: []
disable_suites: [security]
geoip: true
preserve_sources_list: false
primary:
- arches:
- amd64
- i386
uri: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
- arches:
- default
uri: http://ports.ubuntu.com/ubuntu-ports
drivers:
install: false
identity:
hostname: msa
password: $6$x666Mgrn9NRnY5bs$rQogVX3FO3JVFc7wzy4krvMUGiCP6/spTI/b/eVc5kr78AlA2LLf5dtm2yfljjzgUBX4.0Zd97PXHayWz4pFQ/
realname: msa
username: msa
kernel:
package: linux-generic
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
eth1:
dhcp4: false
eth2:
dhcp4: false
eth3:
dhcp4: false
eth4:
dhcp4: false
eth5:
dhcp4: false
eth6:
dhcp4: false
eth7:
dhcp4: false
eth8:
dhcp4: false
eth9:
dhcp4: false
bridges:
br0:
interfaces: [ eth0 ]
addresses: [ 192.168.1.1/24 ]
routes:
- to: default
via: 192.168.1.254
metric: 100
on-link: true
nameservers:
addresses: [ 114.114.114.114 ]
parameters:
stp: true
forward-delay: 4
br1:
interfaces: [ eth1 ]
parameters:
stp: true
forward-delay: 4
br2:
interfaces: [ eth2 ]
parameters:
stp: true
forward-delay: 4
br3:
interfaces: [ eth3 ]
parameters:
stp: true
forward-delay: 4
br4:
interfaces: [ eth4 ]
parameters:
stp: true
forward-delay: 4
br5:
interfaces: [ eth5 ]
parameters:
stp: true
forward-delay: 4
br6:
interfaces: [ eth6 ]
parameters:
stp: true
forward-delay: 4
br7:
interfaces: [ eth7 ]
parameters:
stp: true
forward-delay: 4
br8:
interfaces: [ eth8 ]
parameters:
stp: true
forward-delay: 4
br9:
interfaces: [ eth9 ]
parameters:
stp: true
forward-delay: 4
ssh:
allow-pw: true
authorized-keys: []
install-server: true
storage:
config:
- ptable: gpt
path: /dev/nvme0n1
wipe: superblock-recursive
preserve: false
name: ''
grub_device: false
type: disk
id: disk-nvme0n1
- device: disk-nvme0n1
size: 1127219200
wipe: superblock
flag: boot
number: 1
preserve: false
grub_device: true
offset: 1048576
type: partition
id: partition-0
- fstype: fat32
volume: partition-0
preserve: false
type: format
id: format-0
- device: disk-nvme0n1
size: 2147483648
wipe: superblock
number: 2
preserve: false
grub_device: false
offset: 1128267776
type: partition
id: partition-1
- fstype: ext4
volume: partition-1
preserve: false
type: format
id: format-1
- device: disk-nvme0n1
size: -1
wipe: superblock
number: 3
preserve: false
grub_device: false
offset: 3275751424
type: partition
id: partition-2
- name: ubuntu-vg
devices:
- partition-2
preserve: false
type: lvm_volgroup
id: lvm_volgroup-0
- name: ubuntu-lv
volgroup: lvm_volgroup-0
size: -1
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-0
- fstype: ext4
volume: lvm_partition-0
preserve: false
type: format
id: format-3
- path: /
device: format-3
type: mount
id: mount-3
- path: /boot
device: format-1
type: mount
id: mount-1
- path: /boot/efi
device: format-0
type: mount
id: mount-0
swap:
swap: 0
grub:
# This avoids a loop where we autoinstall, reboot to the autoinstaller USB, then autoinstall again and so on.
reorder_uefi: False
late-commands:
- cp -rp /cdrom/mnt /target/
# copy template file to specify dirctory
- curtin in-target --target=/target -- mv /mnt/template.xml /opt
# disable cloud-init in Ubuntu
- curtin in-target --target=/target -- touch /etc/cloud/cloud-init.disabled
# loading install packages for ubuntu system
- chmod +x /target/mnt/script/install-pkgs.sh
- curtin in-target --target=/target -- /mnt/script/install-pkgs.sh
# copy local file to ISO
- cp -rp /cdrom/mnt/service /target/opt
# to change template file parameters
- chmod +x /target/mnt/script/config.sh
- curtin in-target --target=/target -- /mnt/script/config.sh
# startup kvm images to loading template file
- cp /cdrom/rc-local.service /target/lib/systemd/system/rc-local.service
- curtin in-target --target=/target -- ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
- cp -p /cdrom/rc.local /target/etc/rc.local
- chmod +x /target/etc/rc.local
- systemctl daemon-reload
user-data:
timezone: Asia/Shanghai
# enable root account
disable_root: false
version: 1