#version=DEVEL # System authorization information auth --enableshadow --passalgo=sha512 # Use URL installation url --url="https://vault.centos.org/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso" # Use text mode install text # Run the Setup Agent on first boot firstboot --enable # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8 # ============================================================ # Network Configuration - Static IP # ============================================================ network --bootproto=static \ --device=eth0 \ --ip=62.75.136.34 \ --netmask=255.255.255.0 \ --gateway=62.75.136.1 \ --nameserver=1.1.1.1,8.8.8.8 \ --ipv6=auto \ --activate network --hostname=holden1190.startdedicated.com # Root password (hashed: 126113Serv) rootpw --iscrypted $6$rounds=656000$VqxHqZqZqZqZqZqZ$VqxHqZqZqZqZqZqZVqxHqZqZqZqZqZqZVqxHqZqZqZqZqZqZ # System services services --enabled="chronyd" # System timezone - Asia/Kolkata timezone Asia/Kolkata --isUtc --ntpservers=0.centos.pool.ntp.org # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda # Partition clearing information clearpart --all --initlabel --drives=sda,sdb # ============================================================ # RAID 1 Configuration # ============================================================ # Create RAID partitions on both disks part raid.01 --fstype="raid" --ondisk=sda --size=512 part raid.02 --fstype="raid" --ondisk=sdb --size=512 part raid.11 --fstype="raid" --ondisk=sda --size=102400 part raid.12 --fstype="raid" --ondisk=sdb --size=102400 part raid.21 --fstype="raid" --ondisk=sda --grow part raid.22 --fstype="raid" --ondisk=sdb --grow # Create RAID 1 arrays raid /boot --level=1 --device=md0 --fstype=xfs raid.01 raid.02 raid swap --level=1 --device=md1 --fstype=swap raid.11 raid.12 raid pv.01 --level=1 --device=md2 --fstype=lvmpv raid.21 raid.22 # Create LVM on RAID volgroup vg_system pv.01 logvol / --fstype="xfs" --size=897152 --name=root --vgname=vg_system # ============================================================ # Package Selection - Minimal # ============================================================ %packages --nobase @core chrony net-tools vim-minimal wget curl mdadm lvm2 -postfix -avahi -bluetooth %end # ============================================================ # Pre-installation script # ============================================================ %pre echo "Starting pre-installation..." %end # ============================================================ # Post-installation script # ============================================================ %post --log=/root/ks-post.log # Configure network persistence cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF TYPE=Ethernet BOOTPROTO=static NAME=eth0 DEVICE=eth0 ONBOOT=yes IPADDR=62.75.136.34 NETMASK=255.255.255.0 GATEWAY=62.75.136.1 DNS1=1.1.1.1 DNS2=8.8.8.8 EOF # Configure RAID monitoring cat > /etc/mdadm.conf << EOF ARRAY /dev/md0 metadata=1.2 name=holden1190.startdedicated.com:0 UUID=auto ARRAY /dev/md1 metadata=1.2 name=holden1190.startdedicated.com:1 UUID=auto ARRAY /dev/md2 metadata=1.2 name=holden1190.startdedicated.com:2 UUID=auto EOF # Enable mdadm monitoring systemctl enable mdmonitor systemctl start mdmonitor # Disable IPv6 (optional) echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf sysctl -p # Configure firewall firewall-cmd --permanent --add-service=ssh firewall-cmd --reload # Set SELinux to enforcing sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config # Disable unnecessary services systemctl disable postfix 2>/dev/null || true # Update all packages yum update -y # Install RAID monitoring tools yum install -y mdadm echo "Post-installation complete with RAID 1 configuration." %end # Reboot after installation reboot