[chef] Re: /etc/hosts from template, instead of hostsfile and fqdn cookbooks


Chronological Thread 
  • From: Peter Burkholder < >
  • To: " " < >
  • Subject: [chef] Re: /etc/hosts from template, instead of hostsfile and fqdn cookbooks
  • Date: Wed, 28 Jan 2015 14:33:50 -0500

This cookbook? https://github.com/customink-webops/hostsfile

There's a lot of history behind that cookbook:


and there are 0 open issues with the project. If it's not working for you then you should open an issue with more specific, esp. if there are problems with its dependencies on other cookbooks. Example code that you would like to have working, or that fails, would be helpful in the issue.

If I'm missing the point, let me know.

Cheers,

Peter

 

On Wed, Jan 28, 2015 at 11:25 AM, Nico Kadel-Garcia < " target="_blank"> > wrote:
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
">





--

Peter Burkholder — Customer Success Engineer

Availability: no travel/OOO scheduled

301-204-5767 –  " target="_blank">  – my: Linkedin  Twitter  Calendar

CHEF

CHEF.IO

TM

chef.io   Blog   Facebook   Twitter   Youtube  





Archive powered by MHonArc 2.6.16.

§