Since I was deeply unsatisfied with all the hostname cookbooks out there I wrote a new one.
The main features are:
- substantially more portable (fixes for Docker and stuff like that)
- written as a resource, not a recipe
- by default coerces itself to run at compile_time so you don’t have to fix every other cookbook in existence to
lazy { node['fqdn'] }
- it manages the hosts line in /etc/hosts and lets you override the IP and/or turn this feature off
- it supports FQDNs as hostnames
- i’ve gone through the outstanding PRs and issues on the hostname cookbook and I believe I’ve addressed everything that is in-scope.
The ultimate goal of this cookbook is to RFC it for inclusion into core chef and have a supported, official, correct way of setting the hostname on a server via Chef.
The Windows part of the cookbook is busted, I’m working on that.
I probably won’t support the reading-the-hostname-from-vmware code since that should just get baked into an ohai attribute if its not already.