将variables传递给RHEL7.2安装中的Kickstartfile Networking部分

我想将variables传递给我的Kickstartfile(我使用的是RHEL7.2 Image)。 我知道:你可以读取/ proc / cmdline文件来获取自定义variables。 但这只适用于%pre或%post部分。 有没有办法如何将variables传递给部分networkingconfiguration?

我想要做的是使networkingconfiguration更可变:

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 

像这样的东西:

 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 

我过去也做过类似的事情 这个想法是使用%pre来下载/生成一个临时文件,然后%将其包含在Kickstart中。

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