# Use text install text %pre # Clean out all strange stuff on the disks. Probably change wipefs to # only handle "OS-nvmes" later (ls -d /dev/md/* |xargs -rn1 mdadm --stop) || true (lvdisplay -c|cut -d":" -f1|xargs -rn1 lvremove -y)||true (ls /dev/disk/by-path/pci-0000:*:00.0-nvme-1*|xargs -rn1 wipefs -af)||true partprobe || true # It is good to create partitions before. Otherwise it is not consistent # partition numbering sfdisk <> /etc/dnf/dnf.conf # Some stuff just works better with a fully installed system -- nmcli for example cat < /etc/systemd/system/firstrun.service [Unit] Description=Initial setup ConditionPathExists=!/etc/initial_setup_done [Service] Type=oneshot ExecStart=/usr/local/sbin/firstrun.sh [Install] WantedBy=multi-user.target EOF cat </usr/local/sbin/firstrun.sh #!/bin/bash logger initial_puppet_ping # Util network and resolver works (almost blabla-wait-online.service) while true; do ping -c1 puppet &> /dev/null && break; done hostnamectl set-hostname \$(hostnamectl --transient) logger initial_puppet_install rpm -Uvh http://repo1.uppmax.uu.se/repos/mirror/live/rsync.puppet.com/yum/puppet7/el/9/x86_64/puppet-agent-7.31.0-1.el9.x86_64.rpm # Trying to handle a bug with puppet sometimes ignoring the ssldir in first puppet run ln -s /var/lib/puppetlabs/puppet/ssl /etc/puppetlabs/puppet/ssl /opt/puppetlabs/bin/puppet agent -tv --ssldir /var/lib/puppetlabs/puppet/ssl --vardir /var/lib/puppetlabs/puppet/cache # Grrr puppet... Need to make second run to have all repos correctly installed /opt/puppetlabs/bin/puppet agent -tv systemctl enable --now puppet logger initial_puppet_done update-crypto-policies --set DEFAULT:SHA1 systemctl disable firstrun.service systemctl disable firewalld.service dnf -y install yum-utils screen emacs-nox nmap fping lldpd strace nfs-utils python3-psutil sssd-ldap ipmitool freeipmi iotop iperf3 wget sysstat hdparm htop nethogs hdparm lvm2 bind-utils dmidecode pciutils gnutls-utils ledctl dnf -y update touch /etc/initial_setup_done logger initial_setup_done sleep 10 ipmitool chassis bootdev none options=efiboot sleep 10 reboot EOF chmod +x /usr/local/sbin/firstrun.sh systemctl enable firstrun.service sleep 10 ipmitool chassis bootdev disk options=efiboot sleep 10 %end