3ofcoins/chef-cookbook-hostname — pull request #31 by gh2k (2014-10-07 11:22:25+00:00)
Title: Correctly propagate hostname to subsequent recipes on Ubuntu 14.04

I found that on my Ubuntu 14.04 box node['hostname'] was not being correctly propagated to subsequent recipes, where node['fqdn'] was. (For example, running this recipe followed by the dynect recipe caused an entry to be created with the wrong hostname.)

After much trial and error, I discovered that in order to make this scenario work I had to do both of:
* use `hostnamectl` to set the hostname, instead of the `hostname` command
* explicitly set the hostname automatic node attribute