If I create a CentOS 7 droplet using the default DO-supplied image, I note when going to /etc/hosts to add private IP aliases for my other droplets that there’s this:

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data

If I look at /etc/cloud/templates/ I see three hosts.OSflaver.tmpl files: debian, redhat, and suse. I tried adding my aliases to all three not knowing/caring which is being sourced and rebooted the droplet. Nothing.

I add the entries directly to /etc/hosts and reboot, they stick despite the warning.

Inspecting /etc/cloud/cloud.cfg reveals some DigitalOcean configuration? Not sure if I need to or should attempt to disable manage_etc_hosts as suggested in the hosts comments, figure out how to use the templates, or what?

Anyone have any advice? For now I’m just using /etc/hosts and ignoring the warning comments. So far it seems okay but it’s likely not.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Looks like this is a duplicate of this question

Submit an Answer