updating for packer

This commit is contained in:
2025-07-06 22:14:11 -05:00
parent 631aa6f626
commit baa3bc6562
26 changed files with 1137 additions and 153 deletions

View File

@@ -0,0 +1,54 @@
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/kickstart-commands-and-options-reference_installing-rhel-as-an-experienced-user
#cdrom
# License agreement
eula --agreed
# Use network installation
#url --url="https://mirror.rackspace.com/centos-stream/9-stream/BaseOS/x86_64/os/"
#repo --name="AppStream" --baseurl=http://mirror.rackspace.com/centos-stream/9-stream/BaseOS/x86_64/os/../../../AppStream/x86_64/os/
# Use text mode install
text
# Disable Initial Setup on first boot
firstboot --disable
# Keyboard layout
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=link --activate
network --hostname=fedora.localdomain
# Root password
rootpw $5$CXpezfLKTajPP7yI$VM8STd3QaHBTKMe2DLTmK5p.lEGbUYYZV8jGG3nxX2/ --iscrypted
# SELinux configuration
selinux --enforcing
# Do not configure the X Window System
skipx
# System timezone
timezone US/Chicago --utc
# Add a user named packer
user --groups=wheel --name=wed --password=$5$UOpZHG55fWCHlNSp$nFnpaVLb9enbQTebHo4SKBqolGr39SMYo2ZshHCe2d3 --iscrypted --gecos="wed"
# System bootloader configuration
bootloader --location=mbr --append="crashkernel=auto"
# Clear the Master Boot Record
zerombr
# Remove partitions
clearpart --all --initlabel
# Automatically create partitions using LVM
autopart --type=lvm
# Reboot after successful installation
reboot
%packages --ignoremissing
# dnf group info minimal-environment
@^minimal-environment
# Exclude unnecessary firmwares
-iwl*firmware
%end
%post --nochroot --logfile=/mnt/sysimage/root/ks-post.log
# Disable quiet boot and splash screen
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/etc/default/grub
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/boot/grub2/grubenv
# Passwordless sudo for the user 'wed'
echo "wed ALL=(ALL) NOPASSWD: ALL" >> /mnt/sysimage/etc/sudoers.d/wed
%end

View File

@@ -0,0 +1,64 @@
# Kickstart file for Fedora 41 Server (Text-based Installation)
#
# For use with the Fedora Server netinstall ISO.
# Boot the installer with:
# linux /isolinux/vmlinuz inst.ks=http://<server>/<path>/ks.cfg
#
# For a local file on a USB drive, you can use:
# linux /isolinux/vmlinuz inst.ks=hd:LABEL=<USB_LABEL>:/ks.cfg
# System language, keyboard layout, and timezone
lang en_US.UTF-8
keyboard us
timezone America/Chicago --isUtc
# Installation source
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-41&arch=x86_64
# Use text mode installer
text
# Network configuration
# Using DHCP for automatic network configuration.
# For a static configuration, uncomment and modify the following lines:
# network --bootproto=static --device=eth0 --ip=192.168.1.10 --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=8.8.8.8,8.8.4.4 --hostname=fedora-server
network --bootproto=dhcp --device=eth0 --onboot=on --ipv6=auto --hostname=fedora41-server
# Root password (encrypted)
# To generate an encrypted password, use:
# python -c 'import crypt; print(crypt.crypt("YourPassword", crypt.mksalt(crypt.METHOD_SHA512)))'
rootpw --iscrypted $6$your_encrypted_root_password_hash
# Disk partitioning
# This will erase the specified disk.
# --ondisk=sda can be changed to a more specific device like vda for virtual machines.
# --all will erase all partitions on the disk.
# LVM partitioning scheme is used for flexibility.
zerombr
clearpart --all --initlabel --drives=sda
autopart --type=lvm
# System services
# Disables services not typically required on a minimal server.
services --disabled="kdump,mdmonitor,mdmonitor-takeover" --enabled="sshd,chronyd"
# Package selection
# @^server-product-environment provides a minimal server installation.
# You can add additional packages as needed.
%packages
@^server-product-environment
-@standard
# Add essential command-line tools
vim-enhanced
tmux
git
%end
# Post-installation script
%post --log=/root/ks-post.log
echo "Fedora 41 Server installation complete." > /etc/motd
# Add any additional post-installation tasks here.
%end
# Reboot after installation
reboot