|
| 1 | +#version=RHEL7 |
| 2 | +#Reference for ks.config: http://marclop.svbtle.com/creating-an-automated-centos-7-install-via-kickstart-file |
| 3 | +# Text mode or graphical mode? |
| 4 | +#graphical |
| 5 | +text |
| 6 | + |
| 7 | +# Action |
| 8 | +install |
| 9 | + |
| 10 | +# System authorization information |
| 11 | +auth --enableshadow --passalgo=sha512 |
| 12 | + |
| 13 | +# Use CDROM installation media |
| 14 | +cdrom |
| 15 | + |
| 16 | +# installation path for network installation |
| 17 | +#url --url=http://192.168.0.3:8000/RPM/ |
| 18 | +#repo --name="EPEL" --baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/ |
| 19 | + |
| 20 | +# System language |
| 21 | +lang en_US.UTF-8 |
| 22 | + |
| 23 | +# Keyboard layouts |
| 24 | +keyboard --vckeymap=in-eng --xlayouts='in (eng)' |
| 25 | + |
| 26 | +# Run the Setup Agent on first boot |
| 27 | +firstboot --enable |
| 28 | +ignoredisk --only-use=sda |
| 29 | + |
| 30 | +# Network information |
| 31 | +network --bootproto=dhcp --device=enp0s3 --noipv6 --activate |
| 32 | +# Modify the static ip to a relevant value |
| 33 | +network --bootproto=static --device=enp0s8 --ip=<static_ip> --netmask=255.255.255.0 --noipv6 --activate |
| 34 | +# Specify a hostname |
| 35 | +network --hostname=<hostname> |
| 36 | + |
| 37 | +# Root password |
| 38 | +rootpw --iscrypted $6$8qxjjbNHuAXaJ2/K$kWQ9QEQAmv/FEKmpv7q4RtVsEuOBccfLQjcdZjwk2DM3HOuXIEXrC2E0nNs9SurFC28gMT4hnH.XgHk/pH3ch0 |
| 39 | + |
| 40 | +# System timezone |
| 41 | +timezone Asia/Kolkata --isUtc |
| 42 | + |
| 43 | +# Partition clearing information |
| 44 | +clearpart --linux --drives=sda |
| 45 | +zerombr |
| 46 | + |
| 47 | +# System bootloader configuration |
| 48 | +bootloader --location=mbr --boot-drive=sda |
| 49 | +autopart --type=lvm |
| 50 | + |
| 51 | +# Reboot after installation? |
| 52 | +shutdown |
| 53 | + |
| 54 | +############################################################################## |
| 55 | +# |
| 56 | +# packages part of the KickStart configuration file |
| 57 | +# |
| 58 | +############################################################################## |
| 59 | +%packages |
| 60 | +@core |
| 61 | +kexec-tools |
| 62 | +make |
| 63 | + |
| 64 | +%end |
| 65 | + |
| 66 | +############################################################################## |
| 67 | +# |
| 68 | +# post installation part of the KickStart configuration file |
| 69 | +# |
| 70 | +############################################################################## |
| 71 | +%post |
| 72 | +# |
| 73 | +# This section describes all the post-Anaconda steps to fine-tune the installation |
| 74 | +# |
| 75 | + |
| 76 | +# This line allows printing to console, which otherwise is invisible. |
| 77 | +exec < /dev/console > /dev/console |
| 78 | + |
| 79 | +# Install rpm repo epel-release |
| 80 | +/usr/bin/yum -y install epel-release |
| 81 | + |
| 82 | +# Install net-tools for ifconfig command |
| 83 | +echo "Installing net-tools for ifconfig command." |
| 84 | +/usr/bin/yum -y install net-tools |
| 85 | + |
| 86 | +# Install other dependencies |
| 87 | +echo "Installing other dependencies." |
| 88 | +/usr/bin/yum -y install wget |
| 89 | + |
| 90 | +#/usr/bin/rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
| 91 | +/usr/bin/yum -y epel-release |
| 92 | + |
| 93 | +# Update the RPMs |
| 94 | +echo "Updating the RPMs.." |
| 95 | +/usr/bin/yum -y --skip-broken --obsolete update |
| 96 | + |
| 97 | +# Housekeeping |
| 98 | +echo "Housekeeping.." |
| 99 | +/usr/bin/yum autoremove |
| 100 | +/usr/bin/yum clean all |
| 101 | + |
| 102 | +# Guest Additions |
| 103 | +echo "Installing other dependencies for Guest Additions." |
| 104 | +/usr/bin/yum -y install bzip2 |
| 105 | +/usr/bin/yum -y install gcc |
| 106 | +/usr/bin/yum -y install dkms |
| 107 | +/usr/bin/yum -y install kernel-devel |
| 108 | +#mkdir -p /mnt/cdrom |
| 109 | +#mount -o ro -t iso9660 /dev/sr1 /mnt/cdrom |
| 110 | +#/usr/bin/yum -y --skip-broken update |
| 111 | +#echo 'yes'|/mnt/cdrom/VBoxLinuxAdditions.run |
| 112 | +#umount /dev/sr1 |
| 113 | + |
| 114 | +%end |
0 commit comments