On Thu, Mar 12, 2009 at 2:34 PM, Michael DeHaan <mdehaan@redhat.com> wrote:
Gennadiy Nerubayev wrote:
>  I do have a system with full network config, and it's still not
> templating it at all in the rendered kickstart for that system. The
> same kickstart has pre_install_network_config and network_config which
> do get templated properly, using "new" style.

Please paste "cobbler --version", "cobbler system report", and "cobbler
system getks --name=foo"

cobbler --version
cobbler 1.4.2

build date  : Thu Feb 12 14:37:28 2009


# cobbler system report
system                : box
profile               : rhel5-xen-x86_64
comment               :
created               : Thu Mar 12 15:18:41 2009
gateway               : 10.0.0.1
hostname              : box
image                 :
kernel options        : {}
kernel options post   : {}
kickstart             : <<inherit>>
ks metadata           : {}
mgmt classes          : []
modified              : Thu Mar 12 15:42:10 2009
name servers          : ['10.0.0.9 10.0.0.11']
netboot enabled?      : False
owners                : ['admin']
server                : <<inherit>>
template files        : {}
virt cpus             : 2
virt file size        : <<inherit>>
virt path             : <<inherit>>
virt ram              : 1024
virt type             : <<inherit>>
power type            : ipmitool
power address         :
power user            :
power password        :
power id              :
interface        : eth0
  mac address    : 00:16:3e:27:7a:39
  bonding        :
  bonding_master :
  bonding_opts   :
  is static?     : True
  ip address     : 10.0.0.247
  subnet         : 255.255.255.0
  static routes  : []
  dns name       : box.somedomain.net
  dhcp tag       :
  virt bridge    : xenbr0
interface        : eth1
  mac address    : 00:16:3e:78:a3:c4
  bonding        :
  bonding_master :
  bonding_opts   :
  is static?     : True
  ip address     : 192.168.1.247
  subnet         : 255.255.255.0
  static routes  : ['10.1.1.0/255.255.255.0:10.0.0.1']
  dns name       :
  dhcp tag       :
  virt bridge    : xenbr1

 

# cobbler system getks --name=box
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=http://10.0.0.250/rhel5-64/
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.

# Network information
# Using "new" style networking config, by matching networking information to the physical interface's
# MAC-address
%include /tmp/pre_install_network_config

# Reboot after installation
reboot

#Root password
rootpw --iscrypted $1$mF86/UHC$WvcIcX2t6crBz2onWxyac.
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  America/New_York
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart


%pre

wget "http://10.0.0.250/cblr/svc/op/trig/mode/pre/system/box" -O /dev/null
# Start pre_install_network_config generated code

# Start of code to match cobbler system interfaces to physical interfaces by their mac addresses
#  Start eth1
# Configuring eth1 (00:16:3e:78:a3:c4)
if ifconfig -a | grep -i 00:16:3e:78:a3:c4
then
  IFNAME=$(ifconfig -a | grep -i '00:16:3e:78:a3:c4' | cut -d " " -f 1)
  echo "network --device=$IFNAME --bootproto=static --ip=192.168.1.247 --netmask=255.255.255.0 --gateway=10.0.0.1 --hostname=box" >> /tmp/pre_install_network_config
fi
#  Start eth0
# Configuring eth0 (00:16:3e:27:7a:39)
if ifconfig -a | grep -i 00:16:3e:27:7a:39
then
  IFNAME=$(ifconfig -a | grep -i '00:16:3e:27:7a:39' | cut -d " " -f 1)
  echo "network --device=$IFNAME --bootproto=static --ip=10.0.0.247 --netmask=255.255.255.0 --gateway=10.0.0.1 --hostname=box" >> /tmp/pre_install_network_config
fi
# End pre_install_network_config generated code

# Enable installation monitoring


%packages



%post

# Start yum configuration
wget "http://10.0.0.250/cblr/svc/op/yum/system/box" --output-document=/etc/yum.repos.d/cobbler-config.repo

# End yum configuration
# Start post install kernel options update
/sbin/grubby --update-kernel=`/sbin/grubby --default-kernel` --args="console=xvc xencons=xvc "
# End post install kernel options update



$SNIPPET('post_install_network_config')



# Start download cobbler managed config files (if applicable)
# End download cobbler managed config files (if applicable)

# Start koan environment setup
echo "export COBBLER_SERVER=10.0.0.250" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER 10.0.0.250" > /etc/profile.d/cobbler.csh
# End koan environment setup

# begin Red Hat management server registration
# not configured to register to any Red Hat management server (ok)
# end Red Hat management server registration

# Begin cobbler registration
# skipping for system-based installation
# End cobbler registration

# Enable post-install boot notification

# Start final steps

wget "http://10.0.0.250/cblr/svc/op/ks/system/box" -O /root/cobbler.ks
wget "http://10.0.0.250/cblr/svc/op/trig/mode/post/system/box" -O /dev/null
# End final steps

Note: I used the sample kickstart as my own one contains quite a bit of internal stuff, but the effect of the problem is the same. I also just noticed that the gateway setting gets applied to both interfaces, which is rather undesirable.. hmm.

-Gennadiy