Add an option to use short hostname in RHEL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Low
|
Unassigned |
Bug Description
cloud init with RHEL always use the FQDN over the hostname even if the hostname is sent like below
#cloud-config
---
hostname: shortname
the problem with always using the FQDN as hostname is the linux constrain on hostname length
getconf HOST_NAME_MAX
64
the FQDN is used for DNS and the DNS servers has no limit on that but using as hostname raise an error when cloud init try to set the hostname and fail cloud init
an option should be provided for RHEL like below
#cloud-config
---
enable_shortname: true
to change the default behavior from FQDN to the
1. hostname if send
2. short hostname from the FQDN
and the /etc/resolv.conf
search <domain>
so if the hostname is test.domain.com
the hostname will be *test*
and the
/etc/resolv.conf
search domain.com
Changed in cloud-init: | |
status: | New → Triaged |
importance: | Undecided → Low |
and that is already the behavior for ubuntu, opensuse, ... but rhel /github. com/canonical/ cloud-init/ blob/36ddf1ebed 3f264fa86ef4f65 7dce29244c2e068 /cloudinit/ distros/ __init_ _.py#L259
https:/