I'm dealing with some systems that need internal /etc/hosts entries. I've noticed privously that the hostsfile cookbook is powerful, and flexible, but it really deals with one entry at a time, and that entry is based on the IP address. It can be awkward to clear other entries. And combined with the incomplete and hard-coded settings for the fqdn cookbook, it makes complete control of the /etc/hosts file very awkward.
I think this should, ideally, be a template based cookbook with these features:
* Several entries for normal loopbacks.
* A separate and optional line for an FQDN based loopback
* A separate and optional line for host IP based FQDN addresses.
* A hash or array of IP addresses with a plain stored text field of hostnames and, if desired, comments
That's easy and straightforward to reprogram on an environment or role basis. The difficulty I see is where, for whatever reason, dozens or hundreds of hosts have the same IP address. This is typically tiled to a loopback address used for local filtering, and can often be done more simply than via DNS. In that case, I'd need to have an index for the hash based on some other field, or the IP based index will have hostname fields that are much too large.
This would also make the current 'fqdn' cookbook a lot easier,
So I've wound up with some questions:
1) Has someone else already done this? I can't seem to find a workable such cookbook elsewhere.
2) Is it worth the effort to write and publish?
3) Is it worth the effort to have an index other than the IP address?
Nico Kadel-Garcia
Lead DevOps Engineer
">
Archive powered by MHonArc 2.6.16.