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= --ip= --netmask= --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

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.