https://bugs.launchpad.net/cloud-init/+bug/1966533
I was getting silent failures because the hostname was
host-10-2-65-89.openstack.build.
Instead of
host-10-2-65-89.openstack.build
What actually happens is,
$ sudo hostname host-10-2-65-89.openstack.build.
hostname: the specified hostname is invalid
Background, what I was actually doing was using Terraform,
fqdn: "${fqdn}"
And then setting the fqdn
like this,
fqdn = openstack_networking_port_v2.port_company.dns_assignment[0].fqdn
But the problem is the terraform was return the actual FQDN,
host-10-2-65-89.openstack.build.
But you can't provide that to hostname. My solution was to remove the dot (.
) with https://www.terraform.io/language/functions/trimsuffix
fqdn = trimsuffix(
openstack_networking_port_v2.port_company.dns_assignment[0].fqdn,
"."
)