Test dependencies
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2023-02-22 21:24:42 +01:00
commit f2b0a5e7c7
429 changed files with 20330 additions and 0 deletions

View File

@ -0,0 +1,95 @@
# 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.
# Perform a fresh install, not an upgrade
install
cdrom
# Perform a text installation
text
# Do not install an X server
skipx
# Configure the locale/keyboard
lang en_US.UTF-8
keyboard us
# Configure networking
network --onboot yes --bootproto dhcp --hostname capv.vm
firewall --disabled
selinux --permissive
timezone UTC
# Don't flip out if unsupported hardware is detected
unsupported_hardware
# Configure the user(s)
auth --enableshadow --passalgo=sha512 --kickstart
user --name=builder --plaintext --password builder --groups=builder,wheel
# Disable general install minutia
firstboot --disabled
eula --agreed
# Create a single partition with no swap space
bootloader --location=mbr
zerombr
clearpart --all --initlabel
part / --grow --asprimary --fstype=ext4 --label=slash
%packages --ignoremissing --excludedocs
openssh-server
sed
sudo
# Remove unnecessary firmware
-*-firmware
# Remove other unnecessary packages
-postfix
%end
# Enable/disable the following services
services --enabled=sshd
# Perform a reboot once the installation has completed
reboot
# The %post section is essentially a shell script
%post --erroronfail
# Update the root certificates
update-ca-trust force-enable
# Ensure that the "builder" user doesn't require a password to use sudo,
# or else Ansible will fail
echo 'builder ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder
chmod 440 /etc/sudoers.d/builder
# Install open-vm-tools
yum install -y open-vm-tools
# Remove the package cache
yum -y clean all
# Disable swap
swapoff -a
rm -f /swapfile
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
# Ensure on next boot that network devices get assigned unique IDs.
sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-*
%end

View File

@ -0,0 +1,75 @@
# version=RHEL8
# Install OS instead of upgrade
install
cdrom
auth --enableshadow --passalgo=sha512 --kickstart
# License agreement
eula --agreed
# Use text mode install
text
# Disable Initial Setup on first boot
firstboot --disable
# Keyboard layout
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=link --activate
network --hostname=rhel8
firewall --disabled
# Root password
rootpw builder --plaintext
# SELinux configuration
selinux --permissive
# Do not configure the X Window System
skipx
# System timezone
timezone UTC
# Add a user named builder
user --groups=wheel --name=builder --password=builder --plaintext --gecos="builder"
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
clearpart --all --initlabel --drives=sda
part / --fstype="ext4" --grow --asprimary --label=slash --ondisk=sda
# Reboot after successful installation
reboot
%packages --ignoremissing --excludedocs
# dnf group info minimal-environment
@^minimal-environment
@core
openssh-server
sed
sudo
python3
open-vm-tools
# Exclude unnecessary firmwares
-iwl*firmware
%end
# Enable/disable the following services
services --enabled=sshd
%post --nochroot --logfile=/mnt/sysimage/root/ks-post.log
# Disable quiet boot and splash screen
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/etc/default/grub
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/boot/grub2/grubenv
# Passwordless sudo for the user 'builder'
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /mnt/sysimage/etc/sudoers.d/builder
# Remove the package cache
yum -y clean all
# Disable swap
swapoff -a
rm -f /swapfile
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-*
%end

View File

@ -0,0 +1,60 @@
{
"disk": "/dev/sda",
"hostname": "localhost",
"packages": [
"bash",
"bc",
"bridge-utils",
"bzip2",
"ca-certificates",
"cloud-init",
"cpio",
"cracklib-dicts",
"dbus",
"e2fsprogs",
"file",
"filesystem",
"findutils",
"gdbm",
"grep",
"gzip",
"iana-etc",
"initramfs",
"iptables",
"iproute2",
"iputils",
"libtool",
"linux",
"motd",
"net-tools",
"openssh-server",
"open-vm-tools",
"pkg-config",
"photon-release",
"photon-repos",
"procps-ng",
"rpm",
"sed",
"sudo",
"tdnf",
"tzdata",
"util-linux",
"vim",
"which"
],
"password": {
"age": -1,
"crypted": true,
"text": "*"
},
"postinstall": [
"#!/bin/sh",
"useradd -U -d /home/builder -m --groups wheel builder && echo 'builder:builder' | chpasswd",
"echo 'builder ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder",
"chmod 440 /etc/sudoers.d/builder",
"systemctl enable sshd",
"tdnf clean all",
"swapoff -a",
"rm -f /swapfile"
]
}

View File

@ -0,0 +1 @@
3

1
packer/ova/linux/rhel Symbolic link
View File

@ -0,0 +1 @@
centos

View File

@ -0,0 +1,96 @@
# Use CDROM installation media
repo --name="AppStream" --baseurl="http://download.rockylinux.org/pub/rocky/8/AppStream/x86_64/os/"
cdrom
# Use text install
text
# Don't run the Setup Agent on first boot
firstboot --disabled
eula --agreed
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --onboot=on --ipv6=auto --activate --hostname=capv.vm
# Lock Root account
rootpw --lock
# Create builder user
user --name=builder --groups=wheel --password=builder --plaintext --shell=/bin/bash
# System services
selinux --permissive
firewall --disabled
services --enabled="NetworkManager,sshd,chronyd"
# System timezone
timezone UTC
# System booloader configuration
bootloader --location=mbr --boot-drive=sda
zerombr
clearpart --all --initlabel --drives=sda
part / --fstype="ext4" --grow --asprimary --label=slash --ondisk=sda
skipx
%packages --ignoremissing --excludedocs
openssh-server
open-vm-tools
sudo
sed
python3
# unnecessary firmware
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl*-firmware
-libertas-usb8388-firmware
-ql*-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
-cockpit
-quota
-alsa-*
-fprintd-pam
-intltool
-microcode_ctl
%end
%addon com_redhat_kdump --disable
%end
reboot
%post
echo 'builder ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder
chmod 440 /etc/sudoers.d/builder
# Remove the package cache
yum -y clean all
swapoff -a
rm -f /swapfile
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
systemctl enable vmtoolsd
systemctl start vmtoolsd
# Ensure on next boot that network devices get assigned unique IDs.
sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-*
%end

View File

@ -0,0 +1,15 @@
# 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.
d-i preseed/include string ../base/preseed.cfg

View File

@ -0,0 +1,15 @@
# 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.
d-i preseed/include string ../base/preseed-efi.cfg

View File

@ -0,0 +1,15 @@
# 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.
d-i preseed/include string ../base/preseed.cfg

View File

@ -0,0 +1,87 @@
#cloud-config
# Copyright 2022 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.
# For more information on how autoinstall is configured, please refer to
# https://ubuntu.com/server/docs/install/autoinstall-reference
autoinstall:
version: 1
# Disable ssh server during installation, otherwise packer tries to connect and exceed max attempts
early-commands:
- systemctl stop ssh
# Configure the locale
locale: en_US.UTF-8
keyboard:
layout: us
# Create a single-partition with no swap space. Kubernetes
# really dislikes the idea of anyone else managing memory.
# For more information on how partitioning is configured,
# please refer to https://curtin.readthedocs.io/en/latest/topics/storage.html.
storage:
config:
- type: disk
id: disk-0
size: largest
grub_device: true
preserve: false
ptable: msdos
wipe: superblock
- type: partition
id: partition-0
device: disk-0
size: -1
number: 1
preserve: false
flag: boot
- type: format
id: format-0
volume: partition-0
fstype: ext4
preserve: false
- type: mount
id: mount-0
device: format-0
path: /
updates: 'all'
ssh:
install-server: true
allow-pw: true
# Customize the list of packages installed.
packages:
- open-vm-tools
# Create the default user.
# Ensures the "builder" user doesn't require a password to use sudo.
user-data:
users:
- name: builder
# openssl passwd -6 -stdin <<< builder
passwd: $6$xyz$UtXVazU08Q5b8AW.TJ3MPYZglyXa3Ttf2RCel8MCUPlEYO1evWxeWBhZ2QqivU/Ij4tqYAxMCqc2ujEM4dMSe1
groups: [adm, cdrom, dip, plugdev, lxd, sudo]
lock-passwd: false
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
# This command runs after all other steps; it:
# 1. Disables swapfiles
# 2. Removes the existing swapfile
# 3. Removes the swapfile entry from /etc/fstab
# 4. Cleans up any packages that are no longer required
# 5. Removes the cached list of packages
late-commands:
- swapoff -a
- rm -f /swapfile
- sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
- apt-get purge --auto-remove -y
- rm -rf /var/lib/apt/lists/*

View File

@ -0,0 +1,128 @@
# 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
### Simple GPT configuration w/o LVM
d-i partman-auto/disk string /dev/sda
d-i partman/alignment string cylinder
d-i partman/confirm_write_new_label boolean true
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
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select gpt-boot-root-swap
d-i partman-auto/expert_recipe string \
gpt-boot-root-swap :: \
1 1 1 free \
$bios_boot{ } \
method{ biosgrub } . \
200 200 200 fat32 \
$primary{ } \
method{ efi } format{ } . \
512 512 512 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ /boot } . \
1000 20000 -1 ext4 \
$primary{ } \
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
# Create the default user.
d-i passwd/user-fullname string builder
d-i passwd/username string builder
d-i passwd/user-password password builder
d-i passwd/user-password-again password builder
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
# Disable use of the apt mirror during base install
# This means only packages available in the ISO can be installed
d-i apt-setup/use_mirror boolean false
# Disable the security repo as well (it's on by default)
d-i apt-setup/services-select multiselect none
# Customize the list of packages installed.
d-i pkgsel/include string openssh-server open-vm-tools
# 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 "builder" 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 'builder ALL=(ALL) NOPASSWD: ALL' >/target/etc/sudoers.d/builder ; \
in-target chmod 440 /etc/sudoers.d/builder ; \
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

View File

@ -0,0 +1,128 @@
# 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 debian-installer/add-kernel-opts console=ttyS0
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 builder
d-i passwd/username string builder
d-i passwd/user-password password builder
d-i passwd/user-password-again password builder
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
# Disable use of the apt mirror during base install
# This means only packages available in the ISO can be installed
d-i apt-setup/use_mirror boolean false
# Disable the security repo as well (it's on by default)
d-i apt-setup/services-select multiselect none
# Customize the list of packages installed.
d-i pkgsel/include string openssh-server open-vm-tools
# 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 "builder" 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 'builder ALL=(ALL) NOPASSWD: ALL' >/target/etc/sudoers.d/builder ; \
in-target chmod 440 /etc/sudoers.d/builder ; \
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 apt-get purge --auto-remove -y ; \
in-target rm -rf /var/lib/apt/lists/*