Is there any way to have a generic kickstart for all RHEL releases with full automation?​

环境

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

问题

  • Wanted to have a full automatic kickstart installation for both Red Hat Enterprise Linux 6 and 7.
  • Don't want to specify the ​​url​​ option in kickstart for network installation because those will be different.
  • Currently deploying kickstart infrastructure for a new environment, and would like to have a consolidated kickstart file that will support kernel and repo selection. For example, would like one kickstart file that supports kicking both Red Hat Workstation and Red Hat Server.

决议

  • Here is the example.

​Raw​

install
#NO URL Mentioned
lang en_US
keyboard us
network --bootproto dhcp onboot=yes
zerombr
bootloader --location mbr
timezone America/Denver
auth --enablemd5 --enableshadow
selinux --disabled
rootpw redhat
firewall --disabled
skipx
clearpart --all --initlabel
reboot

part /boot --fstype=ext3 --size=200
part pv.01 --size=1000 --grow
part swap --size=1000 --fstype=swap
volgroup myvg pv.01
logvol /home --vgname=myvg --name=homevol --size=500
logvol / --vgname=myvg --name=rootvol --size=1000 --grow
%packages
@base
@core

  • The above kickstart mentioned that admins wanted to get a prompt for selecting the ​​repo​​, so just provide a kickstart missing the ​​url​​ option which tells ​​anaconda​​ the source of installation.
  • Else one can modify this kickstart and use it for RHEL5/6/7 for both Server as well as workstation too. Just one need to provide the ​​repo​​ for installation on command line as follows.

​Raw​

linux ks=http://path/to/hosted_kickstart.cfg repo=<network_path_to_repository>

  • For example, for RHEL6 server

​Raw​

linux ks=ftp://192.168.0.254/ks.cfg repo=http://192.168.0.254/RHEL6Server/

  • For RHEL6 Workstation.

​Raw​

linux ks=ftp://192.168.0.254/ks.cfg repo=http://192.168.0.254/RHEL6Workstation/

  • Note that the above IPs and links are dummy, one need to create their own repositories hosting RHEL6 Server and workstation DVD contents.