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
Ability to set the box hostname and domain from Vagrantfile #139
Comments
I would say this is more of a thing that should go into provisioners, unless you have a solid argument otherwise. I'm interested. Vagrant 0.6 should (if I can pack it all in!) enhance the provisioners functionality a bit more to make this an easy addition. |
Hi Mitchell, |
Alex, You can already name your VM using this syntax to differentiate them in the Vagrant UI:
As for setting the hostname, I still believe this can be done by a provisioner. Why can't you use chef to set the hostname? Mitchell |
Mitchell, Also I am curios on your feedback to my first attempts to use vagrant and chef: "Quick way to bootstrap chef server with vagrant" - http://bit.ly/cymYtX Regards, |
Alex, No, the name only affects the name that VirtualBox shows for it, not the hostname. And yes, I suppose I am talking about something like what you linked but in a much less complicated way. I guess if you're using chef server you must set the hostname prior to running it. I have some ideas for working around this so I'll work on them, though they are still unrelated to this issue exactly. Mitchell |
Alex, Also, I'll review your article in a bit and comment there =] Thanks! |
Well, come to think about it, perhaps this could be a good way of doing this: config.chef.node_name = "somehost.example.com" in the Vagrantfile and then When I found this setting it was easier to do what I wanted. The default nodename was "client" which was kind of troublesome for me since all vagrant boxes got the recipes etc from the node "client" which isn't at all what I wanted. I was used to setting the fqdn on an ec2 node(through some userdata) and then just run chef against my chef server but with vagrant it works differently... but in reality this could actually be a nice way of setting the fqdn on an ec2 node as well. |
Not sure when this was added, but this works for me to set the hostname:
|
This was added as of 0.7.1. I changed my stance on the issue since the hostname is so crucial to many tools working properly, it made sense to add this. |
It should be |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Well, not much more to say than the title already does but in general this would mean on an Ubuntu system to change the /etc/hostname, /etc/hosts so 127.0.1.1 points to hostname.domain.tld hostname and preferably also change the /etc/resolv.conf so domain and search is set.
Anyone already doing this through vagrant? Am I missing something?
The text was updated successfully, but these errors were encountered: