# Pre tasks
%pre --interpreter=/bin/bash --log=/var/log/ks-pre.log
#raw
+echo
+echo "###########################################################"
+echo
+
echo "[$( date --rfc-3339=seconds )]: Let's launch the missle ..."
echo
+echo "------------"
+echo "Checking nameservers ..."
if grep '^nameserver' /etc/resolv.conf >/dev/null ; then
echo "Nameservers are defined in /etc/resolv.conf:"
grep '^nameserver' /etc/resolv.conf
echo "nameserver 93.188.104.82" >>/etc/resolv.conf
echo "nameserver 217.66.52.10" >>/etc/resolv.conf
fi
-
echo
echo "Used /etc/resolv.conf:"
cat /etc/resolv.conf
+echo
+echo "------------"
+echo "Blockdevices:"
+lsblk
+
+echo
+echo "------------"
+echo "Current Linux-Kernel:"
+uname -a
+
+echo
+echo "------------"
+echo "Current Kernel packages:"
+rpm -qa | grep -i kernel | sort -i
+
+echo
+echo "------------"
+echo "Mkfs.xfs"
+mkfs.xfs -V
+
+
#end raw
%end
# Pre installation tasks
%pre-install --interpreter=/bin/bash --log=/var/log/ks-pre-install.log
#raw
+echo
+echo "###########################################################"
+echo
echo "[$( date --rfc-3339=seconds )]: Pre installation tasks ..."
+
#end raw
%end
### debug
# set -x
+echo
+echo "###########################################################"
+echo
+echo "[$( date --rfc-3339=seconds )]: Post installation tasks in chroot ..."
+
+echo
+echo "------------"
echo "cobbler profile = $profile_name"
echo
+echo "------------"
echo "IP interfaces"
ip link show
echo
+echo "------------"
echo "IP addresses"
ip address show
echo
+echo "------------"
echo "IPv4 routes"
ip route list
echo
+echo "------------"
echo "IPv6 routes"
ip -6 route list
echo
+echo "------------"
echo "/etc/resolv.conf"
cat /etc/resolv.conf
if [[ -d "/etc/yum.repos.d" ]] ; then
echo
+ echo "------------"
echo "/etc/yum.repos.d/"
ls -lA /etc/yum.repos.d
fi
+echo
+echo "------------"
+echo "Current Kernel packages:"
+rpm -qa | grep -i kernel | sort -i
+
+echo
+echo "------------"
+echo "Mkfs.xfs"
+mkfs.xfs -V
+
+echo
+echo "------------"
+echo "Grub installed kernels:"
+grubby --info=ALL
+
+echo
+echo "------------"
+echo "Grub default kernel:"
+grubby --default-index
+grubby --default-title
+grubby --default-kernel
### remove unnecessary directory
rm -rf /var/var