Static Network info is not applied during preseeding on Debian like OSes
When deploying a new instance of Debian/Ubuntu via PXE/DHCP, the Debian Installer ignores static network config.
The problem is described here:
"preseeding the network configuration won't work if you're loading your preconfiguration file from the network"
"Although preseeding the network configuration is normally not possible when using network preseeding (using “preseed/url”), you can use the following hack to work around that, for example if you'd like to set a static address for the network interface. The hack is to force the network configuration to run again after the preconfiguration file has been loaded by creating a “preseed/run” script containing the following commands: kill-all-dhcp; netcfg"
The hack outlined above works, in that the deployed machine has the correct static network info, and is not set to use dhcp. However, the machines hostname and domainname are not set correctly. They are set from DNS, which may not be correct. The fix here is to correct /etc/hostname, /etc/hosts, /etc/resolv.conf and /etc/network/interfaces, in the finish script, before the puppet agent is started on the machine.
Pull request here: https://github.com/theforeman/community-templates/pull/127
Apologies if this does not meet standards or is too hacky, at the very least it brings this issue to light :)
fixes #8314 - static network config for preseed
- fix ignored static network info when pxe booting
o see debian manual https://www.debian.org/releases/wheezy/i386/apbs04.html.en#preseed-network
- pass static var to finish template
o if network config is static then host+domain need fixing in finish template
- update host/domain name if using static network
o when pxe booting via dhcp, debian ignores get_hostname & get_domain string within d-i