# References:
# - https://help.ubuntu.com/community/Installation/LocalNet
# - https://github.com/coreprocess/linux-unattended-installation/blob/master/ubuntu/18.04/custom/preseed.cfg

### Unattended Installation
d-i auto-install/enable boolean true
d-i debconf/priority select high

### Localization
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales string en_US.UTF-8
localechooser localechooser/supported-locales string en_US.UTF-8
d-i localechooser/preferred-locale string en_US.UTF-8
localechooser localechooser/preferred-locale string en_US.UTF-8
d-i console-setup/ask_detect boolean false

d-i keyboard-configuration/xkb-keymap select us
d-i	keyboard-configuration/layout	select	English (US)
d-i	keyboard-configuration/variant	select	English (US)
d-i	keyboard-configuration/layoutcode	string	us

### Network configuration
d-i netcfg/choose_interface select auto

### Base system installation
d-i base-installer/install-recommends boolean true
d-i base-installer/kernel/image string linux-generic

### Account setup
# Skip creation of a root account (normal user account will be able to
# use sudo). The default is false; preseed this to true if you want to set
# a root password.
d-i passwd/root-login boolean false
# Alternatively, to skip creation of a normal user account.
#d-i passwd/make-user boolean false

# Root password, either in clear text
#d-i passwd/root-password password r00tme
#d-i passwd/root-password-again password r00tme
# or encrypted using a crypt(3)  hash.
#d-i passwd/root-password-crypted password [crypt(3) hash]

# To create a normal user account.
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
# Normal user's password, either in clear text
d-i passwd/user-password password ubuntu
d-i passwd/user-password-again password ubuntu
# or encrypted using a crypt(3) hash.
#d-i passwd/user-password-crypted password [crypt(3) hash]
# Create the first user with the specified UID instead of the default.
#d-i passwd/user-uid string 1010
# The installer will warn about weak passwords. If you are sure you know
# what you're doing and want to override it, uncomment this.
d-i user-setup/allow-password-weak boolean true

### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string US/Eastern

# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string ntp.example.com

# Installation source
# Note the value of mirror/country "enter information manually" This is an actual choice in the mirror menu. Choosing this allows us to enter our local repository information.
d-i mirror/country        string manual
# hostname This is whatever HTTP server you have set up.
d-i mirror/http/hostname  string {{pxe.http.get_address()}}
# This is the /ubuntu directory from the install CD copied (or linked) under the webroot of your HTTP server
d-i mirror/http/directory string /ubuntu/releases/18.04/release/mnt/ubuntu
d-i mirror/suite          string bionic
# no proxy
d-i mirror/http/proxy     string

tasksel tasksel/first multiselect openssh-server ubuntu-server
pkgsel pkgsel/update-policy select none

# Reboot when installation completes
finish-install	finish-install/reboot_in_progress	note
# Are you sure you want to exit now?
d-i	di-utils-reboot/really_reboot	boolean	true
