-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hostname not added to /etc/hosts on CentOS 7.0 #4465
Comments
It was incorrectly assumed in #4352 that hostnamectl set-hostname would set everything that the pre-centos/rhel 7.0 process previously did
I believe what was the equivalent to 1 and 2 is definitely done by hostnamectl (its set for the current session and is still there on restart), I'm unsure of whether 4 (and therefore 5) is needed, but 3. Update /etc/hosts definitely isn't done by hostnamectl |
This is the reason I asked but it looks like I got the wrong answer. Got it. |
Thanks for the report! |
I was trying to take a stab at fixing this, but alas, since I use the vmware fusion plugin I failed after jumping through a long series of hoops since the plugin does not work with development versions of vagrant. |
the previous fix for hashicorp#4465 assumed that the NetworkManager takes care of updating /etc/hosts with the new hostname, but testing shows it doesn't. This change ensures that the change is always added to /etc/hosts when the name changes.
I think there's some inconsistency in the usage of the DHCP hostname across guests. Only the redhat < 7 and the pId guests appear to set this, which is either that the other guests magically set this automatically, or the people who provided the PRs only considered their choice distribution for the features |
I must admit I never used DHCP to configure the private/public network adapters, so I have no test setup. According to some info setting DHCP_HOSTNAME is not required when NetworkManager is used, but the RHEL documentation is pretty thin on that issue. It's be easy to adapt the PR, though. |
Hi,
I am using vagrant 1.6.5 and this fixed some of my CentOS 7.0 issues.
It sets the hostname ( I checked with uname -a ) and also my private network device is created.
but my /etc/hosts file is not updated with the FQDN, in CentOS6.5 this works perfectly
Vagrantfile
Thanks
The text was updated successfully, but these errors were encountered: