# Use text install text %pre #(ls -d /dev/md/* |xargs -n1 mdadm --stop) || true #(lvdisplay -c|cut -d":" -f1|xargs -rn1 echo lvremove -y)||true #(ls /dev/disk/by-path/pci-0000:0[2]:00.0-nvme-1|xargs -n1 wipefs -af)||true #partprobe || true %end %addon com_redhat_kdump --disable %end # Keyboard layouts keyboard --xlayouts='se','us' # System language lang en_US.UTF-8 #network --device=enp65s0f0 --bootproto=dhcp --activate #network --device=enp129s0f0np0 --bootproto=static --ip=192.168.240.2 --netmask=255.255.255.0 --gateway=192.168.240.1 --no-activate --nodefroute # Use network installation url --url="http://repo1.uppmax.uu.se/repos/mirror/snapshots/freeze.20240508/rocky/9.3/BaseOS/x86_64/os" logging --host=syslog.uppmax.uu.se eula --agreed reboot --kexec %packages @^minimal-environment tar unzip %end # Run the Setup Agent on first boot firstboot --disable clearpart --all --initlabel zerombr # Generated using Blivet version 3.6.0 ignoredisk --only-use=/dev/disk/by-path/pci-0000:01:00.0-nvme-1 bootloader --location=mbr --boot-drive=/dev/disk/by-path/pci-0000:01:00.0-nvme-1 autopart --type=plain --nohome timesource --ntp-server=nat1.uppmax.uu.se timesource --ntp-server=nat2.uppmax.uu.se # System timezone timezone Europe/Stockholm --utc # Root password rootpw --iscrypted $6$AlquGAvEfjmjtjzq$KD8rrNq9B7cruUIsBReWhGCPisPQH./rTC2hKNvR.zCn2TZkLl4r7Qd1/7qlGbNbi09qzqSqJ/rzQ7RSctADn. %post # Do this directly so no packages sneaks in from the outside mkdir /etc/uppmax.repos.d echo "reposdir=/etc/uppmax.repos.d" >> /etc/dnf/dnf.conf #temp echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.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 # Should be nice with working network-online.target... but not worth it # without network manager and half broken network... #After=network-online.target #Wants=network-online.target [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 sleep 10 /opt/puppetlabs/bin/puppet agent -tv --ssldir /var/lib/puppetlabs/puppet/ssl --vardir /var/lib/puppetlabs/puppet/cache sleep 10 # Grrr puppet... Need to make second run to have all repos correctly installed /opt/puppetlabs/bin/puppet agent -tv --ssldir /var/lib/puppetlabs/puppet/ssl --vardir /var/lib/puppetlabs/puppet/cache sleep 10 #echo 'PUPPET_EXTRA_OPTS=--environment=pelle' >>//etc/sysconfig/puppet sleep 10 systemctl enable --now puppet logger initial_puppet_done update-crypto-policies --set DEFAULT:SHA1 systemctl disable firstrun.service systemctl disable firewalld.service dnf -y --enablerepo=uppmax-live 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 dnf -y update touch /etc/initial_setup_done logger initial_setup_done sleep 10 reboot EOF chmod +x /usr/local/sbin/firstrun.sh systemctl enable firstrun.service %end