This took me about 2 hours to figure out, hopefully it saves you time.
/etc/sysconfig/network:
HOSTNAME=desired-hostname.example.com
/etc/hostname:
desired-hostname.example.com
/etc/cloud/cloud.cfg:
preserve_hostname: true
This took me about 2 hours to figure out, hopefully it saves you time.
/etc/sysconfig/network:
HOSTNAME=desired-hostname.example.com
/etc/hostname:
desired-hostname.example.com
/etc/cloud/cloud.cfg:
preserve_hostname: true