Yes, this is what i typically do. Just with some simple shell scripting in
%post or using something like below (in a separate snippet)

##
## snippet: post_networking
##
## set interfaces, hostname, routing and disable ipv6
##

#set $ikeys = $interfaces.keys()
#for $iface in $ikeys
  #set $vlan_enabled = $iface.find('.')
  #set $idata = $interfaces[$iface]
  #set $ifcfg = "/etc/sysconfig/network-scripts/ifcfg-" + $iface.strip()
  #if $idata["interface_type"].lower() == ""
    echo 'DEVICE=$iface' > $ifcfg
    echo 'BOOTPROTO=static' >> $ifcfg
    echo 'HWADDR=$idata["mac_address"].upper()' >> $ifcfg
    echo 'IPADDR=$idata["ip_address"]' >> $ifcfg
    echo 'NETMASK=$idata["netmask"]' >> $ifcfg
    echo 'NM_CONTROLLED=no' >> $ifcfg
    echo 'ONBOOT=yes' >> $ifcfg
    echo 'USERCTL=no' >> $ifcfg
    #if $vlan_enabled == -1:
    echo 'VLAN=no' >> $ifcfg
    #else
    echo 'VLAN=yes' >> $ifcfg
    #end if
  #end if
  #if $idata["interface_type"].lower() == "bond_slave"
    echo 'DEVICE=$iface' > $ifcfg
    echo 'BOOTPROTO=none' >> $ifcfg
    echo 'ONBOOT=yes' >> $ifcfg
    echo 'MASTER=$idata["interface_master"]' >> $ifcfg
    echo 'SLAVE=yes' >> $ifcfg
    echo 'USERCTL=no' >> $ifcfg
    echo 'VLAN=no' >> $ifcfg
    echo 'NM_CONTROLLED=no' >> $ifcfg
  #end if
  #if $idata["interface_type"].lower() == "bond"
    #set $bondalias = "/etc/modprobe.d/bonding-" + $iface.strip() + ".conf"
    echo 'alias $iface bonding' > $bondalias
    echo 'DEVICE=$iface' > $ifcfg
    echo 'IPADDR=$idata["ip_address"]' >> $ifcfg
    echo 'NETMASK=$idata["netmask"]' >> $ifcfg
    echo 'ONBOOT=yes' >> $ifcfg
    echo 'BOOTPROTO=none' >> $ifcfg
    echo 'USERCTL=no' >> $ifcfg
    echo 'NM_CONTROLLED=no' >> $ifcfg
    echo 'BONDING_OPTS="$idata["bonding_opts"]"' >> $ifcfg
    #if $vlan_enabled == -1:
    echo 'VLAN=no' >> $ifcfg
    #else
    echo 'VLAN=yes' >> $ifcfg
    #end if
  #end if
#end for

rm -f /etc/hostname > /dev/null 2>&1
echo '$my_hostname_fqdn.lower()' >> /etc/hostname

rm -f /etc/sysconfig/network > /dev/null 2>&1
echo "NETWORKING=yes" > /etc/sysconfig/network
echo "NETWORKING_IPV6=no" >> /etc/sysconfig/network
echo "HOSTNAME=$my_hostname_short" >> /etc/sysconfig/network
echo "GATEWAY=$gateway" >> /etc/sysconfig/network

echo "net.ipv6.conf.all.disable_ipv6 = 1" > /etc/sysctl.d/disableipv6.conf
echo 'alias net-pf-10 off' > /etc/modprobe.d/disable-ipv6.conf
echo 'alias ipv6 off' >> /etc/modprobe.d/disable-ipv6.conf

## EOF


Hope this helps!

Cheers,
Jörgen


On Thu, Oct 12, 2017 at 6:50 PM, James Clendenan <[email protected]>
wrote:

> Hi List,
>
> I’ve got a physical system that we’re trying to cobbler build, on a
> management network and then pivot over to using a bonded interface pair for
> the production side.
>
> Looking at the kickstart it should work correctly Post install on the bond
> (or at least will with some tuneing).
>
> However the installer pre_install_networking_config snippet assumes that
> the boot env is identical to the final running environment.
>
> Any suggestions on how we might adjust things to have a pre_boot config
> via dhcp and then a post install config?
>
> Anyone else tried this?  or am I just crazy to try this method?
>
> Side note: this is for an ospf network segment, so I’m trying to avoid
> adding a dhcp server and default gateway to the running environment, hence
> the pivot.
>
> Thanks,
> James
> _______________________________________________
> cobbler mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>



-- 
Grtz,
Jörgen Maas
_______________________________________________
cobbler mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to