# This kickstart file was rendered from the Foreman provisioning template "Kickstart default". url --url https://repo.almalinux.org/almalinux/8.3/BaseOS/x86_64/os lang en_US.UTF-8 selinux --enforcing keyboard us skipx network --device=00:50:56:be:2c:a5 --hostname vm-alma.domain.com --noipv6 --bootproto dhcp --mtu=1500 --nodns rootpw --iscrypted firewall --service=ssh authselect --useshadow --passalgo=sha256 --kickstart timezone --utc UTC services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd bootloader --location=mbr --append="nofb quiet splash=quiet" zerombr clearpart --all --initlabel autopart text reboot %packages yum dhclient chrony -ntp wget @Core redhat-lsb-core %end %post --nochroot exec < /dev/tty3 > /dev/tty3 #changing to VT 3 so that we can see whats going on.... /usr/bin/chvt 3 ( cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf /usr/bin/chvt 1 ) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log %end %post --log=/root/install.post.log logger "Starting anaconda vm-alma.domain.com postinstall" exec < /dev/tty3 > /dev/tty3 #changing to VT 3 so that we can see whats going on.... /usr/bin/chvt 3 # eth0 interface real=`grep -l 00:50:56:be:2c:a5 /sys/class/net/*/{bonding_slave/perm_hwaddr,address} 2>/dev/null | awk -F '/' '// {print $5}' | head -1` sanitized_real=`echo $real | sed s/:/_/` cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real BOOTPROTO="dhcp" DOMAIN="domain.com" DEVICE=$real HWADDR="00:50:56:be:2c:a5" ONBOOT=yes PEERDNS=yes PEERROUTES=yes DEFROUTE=yes MTU=1500 EOF echo "Updating system time" systemctl enable --now chronyd /usr/bin/chronyc -a makestep /usr/sbin/hwclock --systohc rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # update all the base packages from the updates repository if [ -f /usr/bin/dnf ]; then dnf -y update else yum -t -y update fi # SSH keys setup snippet for Remote Execution plugin # # Parameters: # # remote_execution_ssh_keys: public keys to be put in ~/.ssh/authorized_keys # # remote_execution_ssh_user: user for which remote_execution_ssh_keys will be # authorized # # remote_execution_create_user: create user if it not already existing # # remote_execution_effective_user_method: method to switch from ssh user to # effective user # # This template sets up SSH keys in any host so that as long as your public # SSH key is in remote_execution_ssh_keys, you can SSH into a host. This # works in combination with Remote Execution plugin by querying smart proxies # to build an array. # # To use this snippet without the plugin provide the SSH keys as host parameter # remote_execution_ssh_keys. It expects the same format like the authorized_keys # file. touch /tmp/foreman_built %end %post --erroronfail if test -f /tmp/foreman_built; then echo "calling home: build is done!" if [ -x /usr/bin/curl ]; then /usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --data @/mnt/sysimage/root/install.post.log --silent 'http:///unattended/built?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' elif [ -x /usr/bin/wget ]; then /usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' --body-file=/mnt/sysimage/root/install.post.log 'http:///unattended/built?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' else wget -q -O /dev/null --header 'Content-Type: text/plain' 'http:///unattended/built?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' fi else echo "calling home: build failed!" if [ -x /usr/bin/curl ]; then /usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --data @/mnt/sysimage/root/install.post.log --silent 'http:///unattended/failed?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' elif [ -x /usr/bin/wget ]; then /usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' --body-file=/mnt/sysimage/root/install.post.log 'http:///unattended/failed?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' else wget -q -O /dev/null --header 'Content-Type: text/plain' 'http:///unattended/failed?token=6aa5052c-274f-4299-b7ca-6cbc1c1801bf' fi fi sync %end