Created
January 26, 2020 19:33
-
-
Save moondev/65fd98969a1c9705159f7d3535b417a8 to your computer and use it in GitHub Desktop.
ubuntu-1804-preseed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2019 The Kubernetes Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# Configure the locale | |
d-i debian-installer/locale string en_US.utf8 | |
d-i console-setup/ask_detect boolean false | |
d-i console-setup/layout string us | |
# Configure the clock | |
d-i time/zone string UTC | |
d-i clock-setup/utc-auto boolean true | |
d-i clock-setup/utc boolean true | |
# Configure the keyboard | |
d-i kbd-chooser/method select American English | |
# Configure networking | |
d-i netcfg/wireless_wep string | |
# Select the kernel | |
d-i base-installer/kernel/override-image string linux-virtual | |
# Configure a non-interactive install | |
debconf debconf/frontend select Noninteractive | |
# Configure the base installation | |
d-i pkgsel/install-language-support boolean false | |
d-i pkgsel/language-packs multiselect | |
tasksel tasksel/first multiselect # standard, ubuntu-server | |
# Create a single-partition with no swap space. For more information | |
# on how partitioning is configured, please refer to | |
# https://github.com/xobs/debian-installer/blob/master/doc/devel/partman-auto-recipe.txt. | |
d-i partman-auto/method string regular | |
d-i partman-lvm/device_remove_lvm boolean true | |
d-i partman-md/device_remove_md boolean true | |
d-i partman-lvm/confirm boolean true | |
d-i partman-auto-lvm/guided_size string max | |
# Again, this creates a single-partition with no swap. Kubernetes | |
# really dislikes the idea of anyone else managing memory. | |
d-i partman-auto/expert_recipe string \ | |
slash :: \ | |
0 0 -1 ext4 \ | |
$primary{ } $bootable{ } \ | |
method{ format } format{ } \ | |
use_filesystem{ } filesystem{ ext4 } \ | |
mountpoint{ / } \ | |
. | |
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 | |
d-i partman-basicfilesystems/no_swap boolean false | |
d-i partman-md/confirm boolean true | |
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 | |
d-i partman-md/confirm_nooverwrite boolean true | |
d-i partman-lvm/confirm_nooverwrite boolean true | |
d-i partman-partitioning/no_bootable_gpt_biosgrub boolean true | |
d-i partman-partitioning/no_bootable_gpt_efi boolean false | |
d-i partman-efi/non_efi_system boolean false | |
# Create the default user. | |
d-i passwd/user-fullname string ubuntu | |
d-i passwd/username string ubuntu | |
d-i passwd/user-password password ubuntu | |
d-i passwd/user-password-again password ubuntu | |
d-i user-setup/encrypt-home boolean false | |
d-i user-setup/allow-password-weak boolean true | |
# Disable upgrading packages upon installation. | |
d-i pkgsel/upgrade select none | |
d-i grub-installer/only_debian boolean true | |
d-i grub-installer/with_other_os boolean true | |
d-i finish-install/reboot_in_progress note | |
d-i pkgsel/update-policy select none | |
# Select the apt mirror. | |
d-i mirror/country string manual | |
d-i mirror/http/hostname string us.archive.ubuntu.com | |
d-i mirror/http/directory string /ubuntu | |
d-i mirror/http/proxy string | |
# Customize the list of packages installed. | |
d-i pkgsel/include string apt-transport-https \ | |
curl \ | |
ebtables \ | |
gnupg gnupg1 gnupg2 \ | |
jq \ | |
linux-cloud-tools-virtual \ | |
linux-tools-virtual \ | |
open-vm-tools \ | |
openssh-client openssh-server \ | |
conntrack conntrackd \ | |
libnetfilter-acct1 \ | |
libnetfilter-conntrack3 \ | |
libnetfilter-cthelper0 \ | |
libnetfilter-cttimeout1 \ | |
libnetfilter-log1 \ | |
libnetfilter-queue1 \ | |
nfs-client \ | |
ntp \ | |
python3-distutils \ | |
python3-netifaces \ | |
python3-pip \ | |
sed \ | |
socat \ | |
vim | |
# Ensure questions about these packages do not bother the installer. | |
libssl1.1 libssl1.1/restart-without-asking boolean true | |
libssl1.1:amd64 libssl1.1/restart-without-asking boolean true | |
libssl1.1 libssl1.1/restart-services string | |
libssl1.1:amd64 libssl1.1/restart-services string | |
# This command runs after all other steps; it: | |
# 1. Ensures the "ubuntu" user doesn't require a password to use sudo | |
# 2. Cleans up any packages that are no longer required | |
# 3. Cleans the package cache | |
# 4. Removes the cached list of packages | |
# 5. Disables swapfiles | |
# 6. Removes the existing swapfile | |
# 7. Removes the swapfile entry from /etc/fstab | |
d-i preseed/late_command string \ | |
echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' >/target/etc/sudoers.d/ubuntu ; \ | |
in-target chmod 440 /etc/sudoers.d/ubuntu ; \ | |
in-target swapoff -a ; \ | |
in-target rm -f /swapfile ; \ | |
in-target sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab ; \ | |
in-target rm -f /etc/udev/rules.d/70-persistent-net.rules ; | |
#in-target ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules | |
#in-target apt-get -y autoremove --purge | |
#in-target apt-get -y clean | |
#in-target rm -fr /var/lib/apt/lists/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment