I am using Amazon Linux on EC2, passing the following cloud init directives as user data on setup:
#cloud-config
hostname: example.com
locale: en_US.utf8
manage_etc_hosts: true
manage_resolv_conf: false
package_update: true
package_upgrade: true
timezone: Europe/Berlin
Everyting works fine, except the hostname. Somehow it doesn't change, even after a reboot it's still at the IP address. If I try exactly the same with a Red Hat Enterprise Linux AMI, everything works fine - including the hostname. Does anybody know how I can get this working on Amazon Linux, too?