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).
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).