Comment 1 for bug 2088179

Revision history for this message
Nobuto Murata (nobuto) wrote :

If I'm not mistaken the explicit manage_etc_hosts is coming from here:
https://git.launchpad.net/maas/tree/src/maasserver/compose_preseed.py#n403
> def get_base_preseed(node=None):
> """Return the base preseed config used by all ephemeral environments."""
> cloud_config = {
> # The ephemeral environment doesn't have a domain search path set which
> # causes sudo to fail to resolve itself and print out a warning
> # message. These messages are caught when logging during commissioning
> # and testing. Allow /etc/hosts to be managed by cloud-init so the
> # lookup works. This may cause LP:1087183 to come back if anyone tries
> # to JuJu deploy in an ephemeral environment.
> "manage_etc_hosts": True
> }

It wasn't like that when manage_etc_hosts=True was introduced initially and it was purely for an ephemeral environment instead of deployed one.
https://git.launchpad.net/maas/commit/?id=976cd6ca5273da289c6b769d2870614a28de87e5
https://bugs.launchpad.net/maas/+bug/1670444

Then, it looks like this commit dropped a condition for manage_etc_hosts=False without much of explanation.
https://git.launchpad.net/maas/commit/?id=22641cffccea44ded1d20a72d84ba23856730d05
> - config = {
> - # Do not let cloud-init override /etc/hosts/: use the default
> - # behavior which means running `dns_resolve(hostname)` on a node
> - # will query the DNS server (and not return 127.0.0.1).
> - # See bug 1087183 for details.
> - "manage_etc_hosts": False,

manage_etc_hosts=False has the least surprises for MAAS users obviously but if there is a good reason to stick to manage_etc_hosts=True, we should document that explicitly and guide users how to deal with /etc/hosts properly, IMO.