From be24a5dd52fc9c93a04a36284f5187f656b6b81d Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 27 Dec 2024 10:14:00 -0600 Subject: [PATCH] Add generic Fedora kickstarts * `fedora.ks` is used for virtual machines running Fedora Linux * `fedora-rpi.ks` is for Raspberry Pi machines * `common.ks` is shared between the two --- fedora-common.ks | 101 +++++++++++++++++++++++++++++++++++++++++++++++ fedora-rpi.ks | 29 ++++++++++++++ fedora.ks | 21 ++++++++++ 3 files changed, 151 insertions(+) create mode 100644 fedora-common.ks create mode 100644 fedora-rpi.ks create mode 100644 fedora.ks diff --git a/fedora-common.ks b/fedora-common.ks new file mode 100644 index 0000000..d2cb75d --- /dev/null +++ b/fedora-common.ks @@ -0,0 +1,101 @@ +# vim: set ft=sh : +text +url --url http://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os +repo --name=updates --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch +repo --name=dch --baseurl=http://files.pyrocufflink.blue/yum/dch/fedora/$releasever +lang en_US.UTF-8 +keyboard us +timezone --utc UTC +rootpw --lock +reboot + +%packages --exclude-weakdeps +-NetworkManager +-authconfig +-dhcp-client +-dnf-plugins-core +-dnf-yum +-dracut-config-rescue +-man-db +-openssh-clients +-parted +-plymouth +-sssd-common +-sssd-kcm +-sudo +-yum +chrony +dnf +e2fsprogs +grubby +kitty-terminfo +openssh-server +python3-libselinux +python3-policycoreutils +rng-tools +selinux-policy-targeted +sshca-cli-systemd +systemd-networkd +%end + +services --enabled systemd-networkd,systemd-resolved,ssh-host-certs-renew.timer,ssh-host-certs.target --disabled systemd-homed,systemd-nsresourced,systemd-nsresourced.socket,systemd-userdbd,systemd-userdbd.socket + +%addon com_redhat_kdump --disable +%end + +%post --erroronfail +export NO_PROXY='pyrocufflink.blue,*.pyrocufflink.blue' + +echo 'install_weak_deps=0' >> /etc/dnf/dnf.conf +echo 'deltarpm=0' >> /etc/dnf/dnf.conf +echo '%_excludedocs 1' >> /etc/rpm/macros + +# Set the hostname +hostname -f > /etc/hostname + +# Trust SSHCA to authenticate users +curl -fsSL https://sshca.pyrocufflink.blue/user/ca > /etc/ssh/ca.pub +test -s /etc/ssh/ca.pub || exit +cat >> /etc/ssh/sshd_config.d/70-trustedusercakeys.conf <<'EOF' +TrustedUserCAKeys /etc/ssh/ca.pub +EOF + +# Configure SSH daemon to use host certificates obtained from SSHCA +cat > /etc/sysconfig/ssh-host-cert-sign < /etc/ssh/sshd_config.d/10-hostcertificate.conf + +# Configure networking with systemd-networkd +# Use MAC address as client ID to keep the same lease from Anaconda +rm -rf /etc/sysconfig/network-scripts /etc/sysconfig/network +cat > /etc/systemd/network/99-default.network <