I’m trying to set the hostname with chef. I’m using the hostname cookbook.
Everything looks to be configured fine. However, even though the hostname
has been set correctly, a log statement shows the hostname is still the
automatic EC2 assigned one. Running ohai after the chef-client run is
complete also shows the hostname to be the automatic EC2 one. Again, the
configuration of the files are correct, and a hostname -f shows the correct
value. Running chef a second time, the log statement shows the correct
value. Obviously the results of setting the hostname aren’t available until
the next run. How can I fix this?