Pass variables to Kickstartfile Networking part in RHEL7.2 Installation

kickstartlinux-networkingrhel7

I want to pass variables to my Kickstartfile (I`m using RHEL7.2 Image). What i know: you can read the /proc/cmdline file to get custom variables. But this only works in the %pre or %post section. Is there a way how to pass variables to the part were Networking is configured?

What i want to do is making network config more variable:

network  --bootproto=static --device=bond0 --gateway=10.23.138.201 --ip=10.23.138.203 --netmask=255.255.255.248 --noipv6 --activate --bondslaves=eno49,eno1 --bondopts=miimon=100,updelay=10000,downdelay=100,mode=balance-rr
network  --bootproto=static --device=eno2 --onboot=off --noipv6

To something like this:

network  --bootproto=static --device=bond0 --gateway=#{KSGW} --ip=#{KSIP} --netmask=#{KSNM} --noipv6 --activate --bondslaves=#{KSINT1},#{KSINT2} --bondopts=miimon=100,updelay=30000,downdelay=100,mode=balance-rr
network  --bootproto=static --device=eno2 --onboot=off --noipv6

Best Answer

I've done a similar thing in the past. The idea is to use a %pre to download/generate a temporary file, and then %include that in the Kickstart.

Search for %include in https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html

Related Topic