Michael DeHaan wrote:
> 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
>
>
>
>
>
>
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/cobbler
>   

To elaborate, this swaps eth0 for eth1, so if there was a eth0 and an 
eth1 in the file, it finishes up with both of them being called eth1, 
which seems wrong to me.

The code in question is the post_network_config_snippet.

I've gone through (despite my earlier recommendations against it) and 
indented everything ... it will produce weirdly formatted output in the 
ks now but is easier to read, so if folks want to give reading that and 
debugging it a crack, that would be useful.

Meanwhile I'll do some more extended testing with various combinations 
to see that the templates continue to function.  The bonding/vlan stuff 
may be labelled "experimental" for a while though we obviously want to 
make sure the simple cases (eth0, eth1) etc work -- static or not 
static, partial information supplied or lots, etc.

--Michael


_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to