This commit is contained in:
75
packer/ova/linux/centos/http/8/ks.cfg
Normal file
75
packer/ova/linux/centos/http/8/ks.cfg
Normal 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
|
Reference in New Issue
Block a user