blob: 10fb4a3deafe816639a396cc319b5d3bc2523d81 [file] [log] [blame]
Zack Williams5b5d9a72020-11-06 13:59:06 -07001#_preseed_V1
2{#
3SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
4SPDX-License-Identifier: Apache-2.0
5#}
6# preseed docs: https://help.ubuntu.com/18.04/installation-guide/amd64/apbs04.html
7
8# enable automatic install
9d-i auto-install/enable boolean true
10
11# ask only critical level questions
12d-i debconf/priority select critical
13
14# locale and keyboard
15d-i debian-installer/locale string en_US.UTF-8
16d-i console-setup/ask_detect boolean false
17d-i keyboard-configuration/xkb-keymap select us
18
19# clock
20d-i clock-setup/utc boolean true
21d-i time/zone string Etc/UTC
22d-i clock-setup/ntp boolean true
23d-i clock-setup/ntp-server string ntp.ubuntu.com
24
25# network and hostname
26d-i netcfg/choose_interface select auto
27d-i netcfg/hostname string {{ item['hostname'] }}
28d-i netcfg/domain string {{ item['domain'] }}
29d-i hw-detect/load_firmware boolean true
30
31## Storage
32# overwrite previous partitions
33d-i partman-lvm/device_remove_lvm boolean true
34d-i partman-lvm/confirm boolean true
35d-i partman-lvm/confirm_nooverwrite boolean true
36d-i partman-md/device_remove_md boolean true
37d-i partman-md/confirm boolean true
38
39# use lvm
40d-i partman-auto/method string lvm
41d-i partman-auto/init_automatically_partition select biggest_free
42d-i partman-auto-lvm/guided_size string max
43d-i partman-auto-lvm/new_vg_name string primary
44
45# use gpt
46d-i partman-basicfilesystems/choose_label string gpt
47d-i partman-basicfilesystems/default_label string gpt
48d-i partman-partitioning/choose_label string gpt
49d-i partman-partitioning/default_label string gpt
50d-i partman/choose_label string gpt
51d-i partman/default_label string gpt
52
53# use ext4
54d-i partman/default_filesystem string ext4
55
56# partitioning
57d-i partman-auto/choose_recipe select atomic
58d-i partman-partitioning/confirm_write_new_label boolean true
59d-i partman/alignment select optimal
60d-i partman/choose_partition select finish
61d-i partman/confirm boolean true
62d-i partman/confirm_nooverwrite boolean true
63
64# fix issue with grub hang on install
65# https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1663645
66d-i partman/early_command string \
67 while /bin/true; do sleep 0.01; rm -f /target/etc/grub.d/30_os-prober; done &
68
69d-i grub-installer/only_debian boolean true
70
71## Software
72# install mirror
73d-i mirror/country string manual
74d-i mirror/protocol select http
75d-i mirror/http/hostname string us.archive.ubuntu.com
76d-i mirror/http/directory string /ubuntu
77d-i mirror/http/proxy string
78
79# Use the HWE kernel
80d-i base-installer/kernel/image select linux-generic-hwe-18.04
81base-installer base-installer/kernel/image select linux-generic-hwe-18.04
82
83# install openssh and python3
84d-i pkgsel/include string openssh-server python3
85
86# don't install any predefined package groups
87d-i tasksel/first multiselect none
88
89# upgrade all packages on install
90d-i pkgsel/upgrade select full-upgrade
91
92# don't allow root login over SSH
93openssh-server openssh-server/permit-root-login boolean true
94openssh-server openssh-server/password-authentication boolean true
95
96# don't automatically install updates on running system
97pkgsel pkgsel/update-policy select none
98
99# verbose boot, no splashscreen
100d-i debian-installer/quiet boolean false
101d-i debian-installer/splash boolean false
102
103## Users
104# disable root account
105d-i passwd/root-login boolean false
106d-i passwd/root-password-crypted password !!
107
108# create user
109d-i passwd/username string onfadmin
110d-i passwd/user-fullname string ONFAdmin
111d-i passwd/user-password-crypted password {{ preseed_onfadmin_pw_crypt }}
112
113# add SSH pubkey key to user, secure SSHd
114d-i preseed/late_command string \
115 in-target mkdir -p --mode=0700 /home/onfadmin/.ssh ;\
116 in-target sh -c 'echo "{{ preseed_onfadmin_ssh_pubkey }}" > /home/onfadmin/.ssh/authorized_keys';\
117 in-target chmod 0600 /home/onfadmin/.ssh/authorized_keys;\
118 in-target chown -R onfadmin:onfadmin /home/onfadmin/.ssh;\
119 in-target sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/g' /etc/ssh/sshd_config;\
120 in-target sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config;
121
122## Reboot
123d-i finish-install/reboot_in_progress note