DaD
(Daniel Dehennin)
21
Javi Fontán opennebula@discoursemail.com writes:
I’m thinking that setting FQDN is useful but I’m not sure how to implement this.
- Remove “.” restriction from
SET_HOSTNAME
- Add
SET_DOMAIN
and use it to set the FQDN
I believe that letting use “.” is the most straightforward solution and maybe what people expect.
I agree, an FQDN is related to HOSTNAME and DOMAIN with:
- HOSTNAME = FQDN.split(“.”)[0]
- DOMAIN = FQDN.split(“.”).slice(1…-1).join(“.”)
So we can always split SET_HOSTNAME on “.”:
We can use a SET_DOMAIN to define the resolv.conf “domain” and “search”.
Regards.
Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF
madko
(Edouard (Madko))
22
Anything new on this matter ?
darkfader
(Florian Heigl)
23
I’d made a bunch of patches (for DNS_HOSTNAME=yes) that also modified the splitting.
Will put them online on the weekend so you guys can comment.
wt75
(Wt75)
24
I was just looking for a solution to pass Sunstone ‘VM name’ FQDN to VM and found this thread. For anyone that may need it here is my way:
-
Add custom script in Files with content:
#!/bin/bash
[ -n “$SET_HOSTNAME” ] && hostnamectl set-hostname ${SET_HOSTNAME}
-
Enable your custom script in VM template - Context - Files
Add it to ‘Init scripts’ list too
-
in VM template - Context - Custom vars add
SET_HOSTNAME = $NAME
-
Create VM in Sunstone and set VM name to FQDN ‘host.domain.com’
After logging into new VM ‘hostnamectl’ will show FQDN in ‘Static hostname’ field
Without the script your hostname will be truncated to just ‘host’