I recently made a change so that if a system in Cobbler has multiple
interfaces but no details about those interfaces, the kickstart is still
valid -- that is to say, it's trivially easy to make a virtual machine
again that has no MAC, IP, or hostname assignments if someone wants.
However, when I create such a system, I get a network config post
section that I don't /quite/ understand. As I understand it this code
is intended to reorder the NICs such that they are in the right order
(assumed ok) and optionally set up bonding and vlan information (assumed ok)
Here's what I get:
mkdir /etc/sysconfig/network-scripts/cobbler
cp /etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/network-scripts/cobbler/
# Start eth1
sed -i "s/eth0/eth1/" /etc/modprobe.conf
(
grep -v "DEVICE=" /etc/sysconfig/network-scripts/ifcfg-eth0
echo "DEVICE=eth1"
) > /etc/sysconfig/network-scripts/cobbler/ifcfg-eth1
# End eth1
# Start eth0
sed -i "s/eth1/eth0/" /etc/modprobe.conf
(
grep -v "DEVICE=" /etc/sysconfig/network-scripts/ifcfg-eth1
echo "DEVICE=eth0"
) > /etc/sysconfig/network-scripts/cobbler/ifcfg-eth0
# End eth0
rm -f /etc/sysconfig/network-scripts/ifcfg-*
mv /etc/sysconfig/network-scripts/cobbler/* /etc/sysconfig/network-scripts/
rm -r /etc/sysconfig/network-scripts/cobbler
cat /etc/modprobe.conf.cobbler >> /etc/modprobe.conf
rm -f /etc/modprobe.conf.cobbler
# End post_install_network_config generated code
From the above, the two sed lines look redundant. What are they
intended to do?
It looks like they change eth0 to eth1 and then eth1 to eth0, but this
doesn't seme to make since to me.
--Michael