Ask Your Question

Revision history [back]

According to http://cloudinit.readthedocs.io/en/latest/topics/modules.html?highlight=manage_etc_hosts#update-etc-hosts if manage_etc_hosts is false then the template is not applied to /etc/hosts. I tested using virt-edit today to set this to true and it appeared to work in a quick test. I created a new ubuntu 16.04 vm using the modified image and sudo commands did not hang.

The virt-edit command looked like:

virt-edit -a xenial-server-cloudimg-amd64-disk1.img /etc/cloud/cloud.cfg

Just added this near the top of the file:

manage_etc_hosts: true

Not sure if that is the correct thing to do or not though. Comparing the cloud config to Fedora and Centos based images the manage_etc_hosts is not in those files yet sudo works great on them.