theforeman/community-templates — pull request #127 by freddysdad (2014-11-07 11:02:54+00:00)
Title: fix ignored static network info when pxe/dhcp booting

as per the debian manual:

"preseeding the network configuration won't work if you're loading your preconfiguration file from the network".

This condition is met when booting via pxe, therefore we need to use killall.sh to kill dhcp instances then run netcfg to re read static network info. a 2nd issue is that the machines hostname and domainname are taken from the initial dhcp query (which may not necessarily be correct) and thus are not saved correctly. to work round this, use sed to replace the generated /etc/hosts, /etc/hostname, /etc/resolv.conf and /etc/network/interfaces files with the correct information.