Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a kickstart file which I want to use for machines with different numbers of network interfaces. When I have a KS file with multiple network clauses for multiple interfaces, anaconda refuses to run it on a machine with fewer network interfaces than that, because the higher-numbered interfaces are not found.

What I would like to do is have network clauses for the higher numbered network interfaces which are applied when those interfaces are present, but silently dropped if there is no such interface.

Is there a way to express that in a kickstart file?

share|improve this question

1 Answer

up vote 3 down vote accepted

Do you run Kickstart over HTTP? You can manage your Kickstart file as a PHP script and pass it the number of Ethernet interfaces as an argument. Then, in the script you can use conditional statements to either echo the configuration or not based on this. It would like something like this:

<?php
header(“Content-type: text/plain”);
if (!isset($_GET[‘ethcount’])) $ethcount = “1”;
else $ethcount = $_GET[‘ethcount’];
?>
network --device=eth0 --bootproto=dhcp ...etc
<?
if ($ethcount == “2”) {
echo “network --device=eth1 --bootproto=dhcp ...etc”
?>

Then, when you call your Kickstart script, you specify the count.

http://host/kickstart.php?ethcount=2

Note, I've set a default value to 1 if it's not defined in the URL it would default to eth0 only.

http://host/kickstart.php

The options are limitless. I use this for the CPU architecture, distribution, the load (Gnome or headless), etc...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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