I understand that overwriting /etc/hosts, just like overwriting
/etc/hostname and other important files, can cause problems, depending
on how names get assigned by the cloud and how the user wants to
configure the system. Similarly, _not_ overwriting them can cause
problems; in my case, I discovered this problem because the command
"ping `hostname`" didn't work, but "ping localhost" did. So, I would say
that each of these overwritings should be optional and should be
configurable in a fairly obvious way.

What's bad about the current set up is that it's not obvious that
/etc/cloud/templates/hosts.tmpl is in fact completely ignored. I spent a
few hours looking through source code and (non-existent) documentation
in order to convince myself that there was in fact no way to activate
overwriting of /etc/hosts on the basis of that template. So it's
misleading that that file exists, since some files in
/etc/cloud/templates/ are used, and some aren't, and without reading
source code, there's no way to find out which is which.

If you decide that /etc/hosts should never be overwritten, then please
at least remove /etc/cloud/templates/hosts.tmpl. But I'd prefer a
compromise: perhaps if hosts.tmpl exists, then it is used to overwrite
/etc/hosts, otherwise the original stands. That way a user who wants to
disable templates just needs to delete the template file.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-init in ubuntu.
https://bugs.launchpad.net/bugs/720440

Title:
  /etc/hosts is updated based on /etc/cloud/templates/hosts.tmpl

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to