puppetlabs/puppetlabs-dhcp — pull request #9 by jeffmccune (2012-06-11 05:39:24+00:00)
Title: Send the client hostname to be used if unset

Without this patch the hostname is not being set based on the DHCP
offer. This is using a relatively stock Debian Squeeze installation.
The hostname has been cleared from /etc/hostname

This patch requires an accompanying change to dhclient on the agent.
The following exit hook will properly set the hostname on Squeeze.

# /etc/dhcp/dhclient-exit-hooks.d/hostname
export PATH=/opt/puppet/bin:/usr/bin:/bin:/sbin:/usr/sbin:$PATH
hostname $new_host_name
puppet resource host $(facter fqdn) \
ensure=present \
ip=$(facter ipaddress) \
host_aliases=$(facter hostname)