forked from yannbreizh/debian-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preseed-192.168.10.36.cfg
262 lines (225 loc) · 10.1 KB
/
preseed-192.168.10.36.cfg
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
### Preseed file for Debian 10 with
## + static network
## + standard public apt mirrors
## + lvm disk partitioning for proxmox
## + standard system
## + openssh-server sudo sshuttle packages
## + additional commands in the late_command section
## - sed substitutions
## . enable root login in sshd
## . permit empty passwords in sshd
## . permit empty passwords in pam (mandatory for the ansible user which is configured with no password)
## - configure sshd for root
## - copy root ssh key from initrd
## - create ansible user
## - delete ansible password
## - copy ansible ssh key from initrd
## - copy ansible sudoers specific config to be able to sudo with no passwd
##
## log file: /var/log/installer/syslog
## https://www.debian.org/releases/buster/example-preseed.txt
### LOACLES KEYBOARD
# US locale/kbd map
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us
# FR locale/kbd map
#d-i debian-installer/locale string fr_FR
#d-i keyboard-configuration/xkb-keymap select fr(latin9)
#d-i keyboard-configuration/toggle select No toggling
# Additional locales to be generated
d-i localechooser/supported-locales multiselect fr_FR.UTF-8
#### NETWORK
# Automatically select network interface?
d-i netcfg/choose_interface select auto
# d-i netcfg/choose_interface select eth0
# Configure the network manually
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/disable_dhcp boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string 192.168.10.36
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.10.1
d-i netcfg/get_nameservers string 192.168.10.1
d-i netcfg/confirm_static boolean true
# Prevent DHCP asking questions
#d-i netcfg/get_hostname string unassigned-hostname
#d-i netcfg/get_domain string unassigned-domain
d-i netcfg/get_hostname string pvehost2
d-i netcfg/get_domain string pre.cdn.orange.com
# Hostname and domain
d-i netcfg/hostname string pvehost2
d-i netcfg/domain string pre.cdn.orange.com
# Disable WEP dialogue
d-i netcfg/wireless_wep string
#### APT MIRRORS
d-i apt-setup/use_mirror boolean true
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.fr.debian.org
d-i mirror/http/directory string /debian
d-i mirror/suite string buster
d-i mirror/http/proxy string
#### USERS
# root user with crypted password
d-i passwd/root-password-crypted password $6$b1EafBUwFSHXkf7e$gNwIJmY80LwdJg5mrmQahzEYV3QgGoDfRozLqzW9FM9Lg8QFWSFdIfb9zou/flefkXe.p5V2vj8CdYbjpgfzg.
# ansible user with NO password (ssh key will be added)
d-i passwd/make-user boolean false
# d-i passwd/user-fullname string ansible
# d-i passwd/username string ansible
# Normal user's password, either in clear text
#d-i passwd/user-password password ansible
#d-i passwd/suer-password-again password ansible
# or encrypted using a crypt(3) hash.
# command to generate the passwd: 'mkpasswd -m SHA-512'
# d-i passwd/user-password-crypted password $6$N0tnz2Jt$miTOiNXdTt8whMR9rtHVyFQMm2/Aiy7sR/9xrTbVUYVLCIbjNJTK0psAwLZ8BMZW2woTNXXOgTu3h.hHtK1Pw/
# Create the first user with the specified UID instead of the default.
#d-i passwd/user-uid string 2000
# The user account will be added to some standard initial groups. To
# override that, use this.
#d-i passwd/user-default-groups string sudo
#### TIME CLOCK
# Hardware clock is UTC, timezone is US/Eastern, don't use ntp to set clock
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i clock-setup/ntp boolean false
#### DISK PARTITIONING
# Use lvm partitioning
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
# make lvm the max size
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string debian
# use the following partition scheme on /dev/sda
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-lvm
# /boot 500M
# swap 8G (equal to the RAM)
# /root 8G ext4 bootable
# /data 16G+ ext4
d-i partman-auto/expert_recipe string \
boot-lvm :: \
500 500 500 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
4096 8192 8192 linux-swap \
$lvmok{ } \
lv_name{ pve_swap } in_vg { pve_cpop } \
$primary{ } \
method{ swap } format{ } \
. \
4096 8192 8192 ext4 \
$lvmok{ } \
lv_name{ pve_root } in_vg { pve_cpop } \
$primary{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
16384 16384 -1 ext4 \
$lvmok{ } \
lv_name{ pve_data } in_vg { pve_cpop } \
$primary{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /data } \
.
# # /boot 500M ext4
# # swap 2G
# # /tmp 2G ext4
# # /var/log 4G ext4
# # / 8G+ ext4
# d-i partman-auto/expert_recipe string \
# boot-lvm :: \
# 500 500 500 ext4 \
# $primary{ } $bootable{ } \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ ext4 } \
# mountpoint{ /boot } \
# . \
# 2048 2048 200% linux-swap \
# $lvmok{ } \
# lv_name{ swap } in_vg { debian } \
# $primary{ } \
# method{ swap } format{ } \
# . \
# 2048 2048 2048 ext4 \
# $lvmok{ } \
# lv_name{ tmp } in_vg { debian } \
# $primary{ } \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ ext4 } \
# mountpoint{ /tmp } \
# . \
# 4000 4096 4096 ext4 \
# $lvmok{ } \
# lv_name{ var_log } in_vg { debian } \
# $primary{ } \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ ext4 } \
# mountpoint{ /var/log } \
# . \
# 8192 8192 -1 ext4 \
# $lvmok{ } \
# lv_name{ root } in_vg { debian } \
# $primary{ } \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ ext4 } \
# mountpoint{ / } \
# .
# remove any RAID partitioning
d-i partman-md/device_remove_md boolean true
# Don't confirm anything
d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
#### OTHERS
# Setup of non-free and contrib repositories
d-i apt-setup/non-free boolean false
d-i apt-setup/contrib boolean false
# Avoid "Scan another CD or DVD?" message
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
# Install standard system
tasksel tasksel/first multiselect standard
# Also install additional package
d-i pkgsel/include string openssh-server sudo sshuttle
openssh-server openssh-server/permit-root-login boolean true
# Upgrade all packages
d-i pkgsel/upgrade select full-upgrade
# Disable popularity contest
popularity-contest popularity-contest/participate boolean false
#### GRUB
# Force grub install to /dev/sda
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string /dev/sda
#### FINALISATION
# Late commands to add specific features
d-i preseed/late_command string \
sed -i '/PermitRootLogin/c PermitRootLogin yes' /target/etc/ssh/sshd_config ; \
sed -i '/#PermitEmptyPasswords/c PermitEmptyPasswords yes' /target/etc/ssh/sshd_config ; \
sed -i 's/nullok_secure/nullok/' /target/etc/pam.d/common-auth ; \
in-target mkdir /root/.ssh ; \
in-target chmod 700 /root/.ssh ; \
cp /custom/root_pub_key.pub /target/root/.ssh/authorized_keys ; \
cp /custom/root_pri_key.pub /target/root/.ssh/id_rsa ; \
in-target useradd -m -d /home/ansible -G sudo -s /bin/bash ansible ; \
in-target passwd ansible -d ; \
in-target mkdir /home/ansible/.ssh ; \
in-target chmod 700 /home/ansible/.ssh ; \
cp /custom/ansible_key.pub /target/home/ansible/.ssh/authorized_keys ; \
cp /custom/ansible.sudoers /target/etc/sudoers.d/ansible ; \
in-target chmod 0440 /etc/sudoers.d/ansible
#d-i preseed/late_command string wget http://pxe.lab.mydomain/sources.list -O /target/etc/apt/sources.list
# don't wait for confirm, just reboot when finished
d-i finish-install/reboot_in_progress note