[Spacewalk-list] cobbler buildiso and no dhcp

Josh Preston JoshPreston at dswinc.com
Thu Mar 29 19:52:48 UTC 2012


I also have the same DHCP restriction and utilize cobbler's bootiso; we overcome it by using kernel boot parameters (pressing TAB and appending them to the boot options)

	ksdevice=ethX ip=1.2.3.4 netmask=255.255.255.0 gateway=2.3.4.5 dns=3.4.5.6 hostname=my.fqdn.local

Additionally, we have a PRE script that performs the magic stuff so networking configurations persist through initial installation:

---
# Begin spacewalk/1/pre-configure-networking snippet

#set $HOSTNAME = $getVar("$hostname", "$hostname")
#set $GATEWAY = $getVar("$gateway", "$gateway")
#set $IP = $getVar("$ip", "$ip")
#set $NETMASK = $getVar("$netmask", "$netmask")
#set $DNS = $getVar("$dns", "$dns")

#if $getVar("$system_name", "") == ""
    #raw
for I in $(cat /proc/cmdline); do
    case "$I" in *=*)
        eval $I; export $I;
    esac;
done
    #end raw
#end if

echo "network --ip=$IP --hostname=$HOSTNAME --nameserver=$DNS --netmask=$NETMASK --gateway=$GATEWAY --bootproto=static --noipv6 --onboot=yes" > /tmp/networkconfig
echo "NETWORKING=yes
HOSTNAME=$HOSTNAME
GATEWAY=$GATEWAY" > /tmp/network

# End spacewalk/1/pre-configure-networking snippet
---

As a side note, you'd probably do yourself a favor and write a POST script to properly set the hostname (since you're not DHCPing and at least for us, we like to build machines before a DNS entry might exist).

---
# Begin spacewalk/1/post-configure-hostname snippet

# 1. if the system's hostname is not set or equals localhost.localdomain or it's set to ip address
#   a. configure the hostname using the kernel command line options
#   b. configure the hostname using cobbler system data
# 2. create our valid /etc/hosts entries

#set $HOSTNAME = $getVar("$hostname", "$hostname")
#set $GATEWAY = $getVar("$gateway", "$gateway")
#set $IP = $getVar("$ip", "$ip")

HOSTNAME="$HOSTNAME"
GATEWAY="$GATEWAY"
IP="$IP"

#if $getVar("$system_name", "") == ""
    #raw
for I in $(cat /proc/cmdline); do
    case "$I" in *=*)
        eval $I; export $I;
    esac;
done
    #end raw
#end if

if [ -z "$HOSTNAME" || "$HOSTNAME" = "localhost" || "$HOSTNAME" = "localhost.localdomain" || "$HOSTNAME" == "$IP" ]; then

    # bring in hostname specified on the command line
    if [ -f /tmp/network ]; then
        cp /tmp/network /mnt/sysimage/etc/sysconfig/network
    else # create the valid entry
        echo "NETWORKING=yes
HOSTNAME=$HOSTNAME
GATEWAY=$GATEWAY" > /mnt/sysimage/etc/sysconfig/network
    fi

fi

# bring in the new network settings
. /mnt/sysimage/etc/sysconfig/network

# force hostname change
/mnt/sysimage/bin/hostname $HOSTNAME

# setup variables for use in /etc/hosts
LONG=`/mnt/sysimage/bin/hostname`
SHORT=`/mnt/sysimage/bin/hostname -s`
echo "$IP        \${LONG} \${SHORT}" >> /mnt/sysimage/etc/hosts

# End spacewalk/1/post-configure-hostname snippet
---

Alternatively, you could go your other route of adding the system to cobbler prior to building the ISO and just hitting ENTER on the desired system :-)

-----Original Message-----
From: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of urgrue
Sent: Tuesday, March 27, 2012 9:03 AM
To: spacewalk-list at redhat.com
Subject: [Spacewalk-list] cobbler buildiso and no dhcp

Hi,
I'm trying to provision systems with spacewalk. I have no possibility to use dhcp so as a result I need to do cobbler buildiso and boot from that. The issue is that the .iso defaults to booting with DHCP to get the the initial networking info (to fetch the kickstart). So as far as I can tell, I must do a 'cobbler system add' and specify all the host/IP information this way, then I can select this specific system from the cobbler boot menu.
Is there an alternative way that is better integrated into spacewalk?
I'd like to avoid maintaining system/IP information in two places (or scripting something to do it), which is what this results in. 
Thanks.

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list