Setting hostname via config is not reflected in /etc/hosts
Bug #768296 reported by
Avishai Ish-Shalom
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Invalid
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
When setting the hostname using the hostname attribute (cc_set_hostname plugin), cc_update_etc_hosts will ignore the modified hostname and use the default hostname instead.
tags: | added: ec2-images uec-images |
To post a comment you must log in.
You are correct that setting hostname in cloud-config does not update /etc/hosts.
The value that you set in cloud-config should be correctly written to '/etc/hostname' (by cc_set_hostname).
If you also set 'manage_etc_hosts: True' then your hostname will also be written to /etc/hosts.
So, to do what you want:
#cloud-config
manage_etc_hosts: True
hostname: my-hostname-here
Do you think that is acceptable ?
I'm marking this as "Incomplete", please comment back and either move it to 'New' or 'Invalid' (or whatever state you might think is best).