Skip to content

Instantly share code, notes, and snippets.

@devynspencer
Last active October 24, 2022 03:05
Show Gist options
  • Save devynspencer/99cbcf0b09245e285ee4 to your computer and use it in GitHub Desktop.
Save devynspencer/99cbcf0b09245e285ee4 to your computer and use it in GitHub Desktop.
Minimal Kickstart template for Centos 7.x
#
# configure installation settings
install
cdrom
lang en_US.UTF-8
keyboard us
timezone UTC
unsupported_hardware
text
skipx
firstboot --disabled
reboot
%include /tmp/partitions.ks
# configure system settings
auth --enableshadow --passalgo=sha512 --kickstart
network --bootproto=dhcp
firewall --enabled --ssh
selinux --permissive
rootpw password
%packages --nobase --ignoremissing --excludedocs # install minimal packages
@core
%end
%pre # setup disk partitions using either sda or vda disks
if [ -b /dev/vda ]; then
drive_type=vda
elif [ -b /dev/sda ]; then
drive_type=sda
fi
cat << EOF > /tmp/partitions.ks
zerombr
bootloader --location=mbr --driveorder=$drive_type
clearpart --all --initlabel --drives=$drive_type
part /boot/efi --fstype='vfat' --ondisk=$drive_type --size=256
part /boot --recommended
part swap --recommended
part pv.1 --fstype='lvmpv' --ondisk=$drive_type --size=1 --grow
volgroup system pv.1
logvol / --vgname=system --fstype=xfs --name=root --size=1 --grow
logvol /home --vgname=system --fstype=xfs --name=home --size=2048
logvol /tmp --vgname=system --fstype=xfs --name=tmp --size=1024
logvol /var/log --vgname=system --fstype=xfs --name=var_log --size=512
logvol /var/log/audit --vgname=system --fstype=xfs --name=var_log_audit --size=256
EOF
%end
%post # configure sudoers
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/workstation # add sudo profiles for ansible and vagrant
sed -i "s/^[^#].*requiretty/#Defaults requiretty/" /etc/sudoers # disable requiretty setting
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment