3ofcoins / chef-cookbook-hostname

Chef cookbook to set node's hostname and FQDN.
MIT License
41 stars 90 forks source link

removing old hostsfile entries on DHCP #38

Open timurb opened 9 years ago

timurb commented 9 years ago

Hi, thanks for a great piece of software!

I've just noticed a minor issue which I'd like to have fixed:

When you are running an EC2 instance outside of VPC (or simply when a server receives an IP via DHCP) on the next poweroff/startup cycle it is going to get a new IP address. The cookbook will create a new hostsfile entry but will not remove the old one.

This is probably ok for most cases but for some software like Hadoop it becomes critical.

To deal with that you just have to add unique true to the hostsfile_entry[set hostname] resource. I'd create a pull request for that but I wanted to discuss first, do you think it should be made configurable so that you could keep an old behaviour if needed? Or do you think just putting unique true there would be ok?

xamebax commented 9 years ago

Hey, thanks!

Unfortunately, I have no experience with Hadoop, but from what I understand, this seems to be a good idea. I'm not sure whether it has to be configurable, but maybe @mpasternacki could chime in?