# Use graphical install
graphical
repo --name="Minimal" --baseurl=file:///run/install/sources/mount-0000-cdrom/Minimal
%packages
@^minimal-environment
@standard
openssh-server
openssh-clients
sudo
# unnecessary firmware
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
%end
# Keyboard layouts
keyboard --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=ens18 --ipv6=auto --activate
network --hostname=localhost.localdomain
# Use CDROM installation media
cdrom
# Run the Setup Agent on first boot
firstboot --disabled
# Do not configure the X Window System
skipx
# Partition information
%include "/tmp/part-include"
# System timezone
timezone America/Edmonton --isUtc --nontp
# Root password
rootpw --iscrypted $6$tAJB3y5cwWgliCme$sUtnke72wBUdrObmf6c.0YK61hiY9MgVxwU/JFJY6j.7OrnC1Y6yCJzCBgrMI9zbVbxOE6vaO7IIK9Ug2sccr.
reboot
%end
%pre
disk_partition() {
local Disks=""
for Device in `ls -d /sys/block/sd* /sys/block/vd* 2> /dev/null`; do
# Add only non-removable devices.
local Removable=`cat $Device/removable`
if [ $Removable == "0" ] ; then
Disks="$Disks `basename $Device`"
fi
done
FirstDisk=`echo $Disks | cut -d' ' -f1`
cat <<EOF > /tmp/part-include
# Use $FirstDisk only
ignoredisk --only-use=$FirstDisk
zerombr
# System bootloader configuration
bootloader --location=mbr --boot-drive=$FirstDisk
clearpart --all --initlabel --drives=$FirstDisk
# Disk partitioning information
part biosboot --fstype=biosboot --size=1
part /boot --fstype="ext4" --ondisk=$FirstDisk --size=512
part pv.1 --fstype="lvmpv" --ondisk=$FirstDisk --size=9727 --grow
volgroup rl_vol --pesize=4096 pv.1
logvol / --fstype="xfs" --size=6655 --name=root --vgname=rl_vol
logvol /var --fstype="xfs" --size=2048 --name=var --vgname=rl_vol
logvol swap --fstype="swap" --size=1024 --name=swap --vgname=rl_vol
EOF
}
disk_partition
# Update hosts for mirrors hosted on admin host
echo 10.44.120.254 dl.rockylinux.org download.rockylinux.org repo.mysql.com download.cloudstack.org mirror.its.dal.ca >> /etc/hosts
%end
%end
%post
# Update hosts for mirrors hosted on admin host
echo 10.44.120.254 dl.rockylinux.org download.rockylinux.org repo.mysql.com download.cloudstack.org mirror.its.dal.ca >> /etc/hosts
# this is installed by default but we don't need it in virt
echo "Removing linux-firmware package."
yum -C -y remove linux-firmware
# Remove firewalld; it is required to be present for install/image building.
echo "Removing firewalld."
yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
# remove avahi and networkmanager
echo "Removing avahi/zeroconf and NetworkManager"
yum -C -y remove avahi\*
echo -n "Getty fixes"
# although we want console output going to the serial console, we don't
# actually have the opportunity to login there. FIX.
# we don't really need to auto-spawn _any_ gettys.
sed -i '/^#NAutoVTs=.*/ a\
NAutoVTs=0' /etc/systemd/logind.conf
# set virtual-guest as default profile for tuned
echo "virtual-guest" > /etc/tuned/active_profile
# make sure firstboot doesn't start
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
echo "Fixing SELinux contexts."
touch /var/log/cron
touch /var/log/boot.log
mkdir -p /var/cache/yum
/usr/sbin/fixfiles -R -a restore
# reorder console entries
sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg
# QEMU Agent
yum -y install qemu-guest-agent
systemctl enable qemu-guest-agent
# Cloud Init for CloudStack
yum -y install cloud-init cloud-utils-growpart gdisk
systemctl enable cloud-init.service
cat <<EOF > /etc/cloud/cloud.cfg.d/99_cloudstack.cfg
datasource:
CloudStack: {}
None: {}
datasource_list:
- CloudStack
EOF
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end