Skip to content

Instantly share code, notes, and snippets.

@boxrick
Created August 22, 2018 12:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxrick/3a4022d003daa63b7d27cca7f0f99894 to your computer and use it in GitHub Desktop.
Save boxrick/3a4022d003daa63b7d27cca7f0f99894 to your computer and use it in GitHub Desktop.
Preseed - Bionic
#Preseed Ubuntu
d-i debconf/priority select critical
d-i auto-install/enabled boolean true
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/variantcode string
# Add Ansible PPA and key for latest Ansible
d-i apt-setup/local0/repository string deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main
d-i apt-setup/local0/comment string Ansible PPA
d-i apt-setup/local0/key string http://keyserver.ubuntu.com/pks/lookup?search=0x93C4A3FD7BB9C367&op=get
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# NTP/Time Setup
d-i time/zone string Europe/London
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string INTERNALNTP
# Setup the installation source
d-i mirror/country string manual
d-i mirror/http/hostname string INTERNALMIRROR
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string INTERNALPROXY
# Verbose output and no boot splash screen
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false
d-i grub-installer/timeout string 2
d-i grub-installer/only_debian boolean true
# Add in some kernel options, this is to allow fast scrolling of text on bootup and force a fixed low resolution on the console.
d-i debian-installer/add-kernel-opts string vga=0x361 video=vesafb:ywrap,mtrr:3
# Disk Partitioning
# Make sure we select the first disk and unmount media
d-i partman/early_command string \
USBDEV=$(list-devices usb-partition | sed "s/\(.*\)./\1/");\
BOOTDEV=$(list-devices disk | grep -v "$USBDEV" | head -1);\
debconf-set partman-auto/disk $BOOTDEV;\
debconf-set grub-installer/bootdev $BOOTDEV; \
umount /media || true;
# GPT Options
d-i partman-basicfilesystems/choose_label string gpt
d-i partman-basicfilesystems/default_label string gpt
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt
d-i partman/choose_label string gpt
d-i partman/default_label string gpt
partman-partitioning partman-partitioning/choose_label select gpt
# LVM Options
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/new_vg_name string volgroup0
d-i partman-auto-lvm/guided_size string 100%
# Set up LVM
d-i partman-auto/method string lvm
partman-auto/choose_recipe select atomic
d-i partman-auto/alignment string optimal
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i mdadm/boot_degraded boolean true
## additional misc lines to prevent dialogue ##
partman-lvm partman-lvm/confirm_nochanges boolean true
partman-base partman/confirm_nochanges boolean true
partman-crypto partman-crypto/confirm_nochanges boolean true
partman-partitioning partman-partitioning/confirm_resize boolean true
d-i partman-crypto/confirm_nooverwrite boolean true
partman-base partman/confirm_nooverwrite boolean true
partman-crypto partman-crypto/confirm boolean true
partman-partitioning partman-partitioning/confirm_new_label boolean true
partman-md partman-md/confirm_nochanges boolean true
# root account and password
d-i passwd/user-fullname string Support User
d-i passwd/username string mist-admin
d-i passwd/user-password-crypted password ENCRYPTEDPASSHERE
d-i passwd/user-gid string 20001
d-i passwd/user-uid string 20001
d-i user-setup/encrypt-home boolean false
d-i pkgsel/update-policy select none
# Set mirror
d-i apt-setup/services-select multiselect security
d-i apt-setup/security_host string security.ubuntu.com
d-i apt-setup/security_path string /ubuntu
# Add installs
d-i pkgsel/include string ntp ssh wget python screen git vim ansible lldpd
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
# Set physical link
d-i netcfg/choose_interface select auto
# Static network configuration if defined
# Run postinstall script
d-i preseed/late_command string cat /cdrom/extra_binaries/postinstall.sh > /target/root/late_command.sh && chmod u+x /target/root/late_command.sh && in-target '/root/late_command.sh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment