From 87256e1f76f1453cc5cceea56d4514ec629d5e71 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 3 Jun 2010 15:24:58 -0700 Subject: [PATCH] Added systems to changelog and updated systems docs. Added new Vagrantfile options to the options page. --- docs/changes/changes_03x_04x.md | 10 ++++++++++ docs/systems.md | 8 ++++++-- docs/vagrantfile.md | 23 ++++++++++++++--------- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/docs/changes/changes_03x_04x.md b/docs/changes/changes_03x_04x.md index f91768f74..d356cd530 100644 --- a/docs/changes/changes_03x_04x.md +++ b/docs/changes/changes_03x_04x.md @@ -40,6 +40,16 @@ which are detected. TODO: Docs +## New Abstraction: Systems + +"Systems" are a new abstraction within Vagrant which allow OS or system +specific behaviour such as shutdown or mounting folders to be defined within +a specific system class, which is then configured within the Vagrantfile. +Vagrant ships with a general Linux system which should cover the majority +of users and is the default system. + +For more information, please read the [systems documentation](/docs/systems.html). + ## Minor Changes ### `vagrant provision` diff --git a/docs/systems.md b/docs/systems.md index 3e7c5778a..d628b8599 100644 --- a/docs/systems.md +++ b/docs/systems.md @@ -25,6 +25,8 @@ The following is a list of tasks which are delegated to system classes: * **Halting** - Shutting down the machine gracefully * **Mounting Shared Folders** - Creating, mounting, and setting up the permissions for shared folders. +* **Enabling Host Only Networks** - Preparing and enabling host only networks on + specified interfaces. This list will surely grow as Vagrant grows. For now, to implement a custom operating system implementation, only the above two features need to be implemented. @@ -34,7 +36,9 @@ system implementation, only the above two features need to be implemented. Creating a new system implementer is quite simple: Inherit from `Vagrant::Systems::Base` and implement the stubbed method on that class. Instead of going over each method here, I'll point you to the [base source file](http://github.com/mitchellh/vagrant/blob/master/lib/vagrant/systems/base.rb) -which is thoroughly commented to explain each method. +which is thoroughly commented to explain each method. Its also recommended you view the +[linux system](http://github.com/mitchellh/vagrant/blob/master/lib/vagrant/systems/linux.rb) +which is currently the only system shipped with Vagrant. ## Using a New System Implementer @@ -53,4 +57,4 @@ Vagrant::Config.run do |config| end {% endhighlight %} -The configured Vagrant environment will then use the custom system implementation. \ No newline at end of file +The configured Vagrant environment will then use the custom system implementation. diff --git a/docs/vagrantfile.md b/docs/vagrantfile.md index 229783f35..e11609734 100644 --- a/docs/vagrantfile.md +++ b/docs/vagrantfile.md @@ -68,14 +68,6 @@ to use a custom SSH keypair. `config.ssh.timeout` specifies the timeout when trying to connect to the virtual environment. -### Deprecated SSH Configuration - -These configuration keys will be completely removed in the next version of Vagrant. -They do nothing in the current version: - -* `config.ssh.password` - Password SSH authentication has been completely - removed. This setting does nothing in the current version of Vagrant. - ## config.vm Vm settings are used when creating new virtual machines to alert Vagrant about how they @@ -116,6 +108,9 @@ config.vm.customize do |vm| end {% endhighlight %} +`config.vm.define` is a method which allows you to define a new VM for a multi-VM environment. Since +this is a huge topic in itself, please read its dedicated documentation page for more details. + `config.vm.disk_image_format` alerts Vagrant to the prefered virtual disk image file format for use when creating new virtual machines. VirtualBox supports many disk formats such as .vdi (VirtualBox's own format), .vmdk (VMWare's disk image format), and .vhd (Microsoft's format). @@ -126,12 +121,22 @@ port 22 on the guest for ssh. Example usage of this is shown below: {% highlight ruby %} config.vm.forward_port("web", 80, 8080) config.vm.forward_port("ftp", 21, 4567) +config.vm.forward_port("ssh", 22, 2222, :auto => true) {% endhighlight %} The first parameter of the `forward_port` method is simply a key used internally to reference the forwarded port. It doesn't affect the actual ports forwarded at all. The above example could've changed `web` to `fluffy bananas` and it still would've worked fine. +The final parameter is a hash of options which can be used to configure details of the forwarded +ports. `:adapter` allows you to specify which network adapter to forward the ports on. And if `:auto` +is set to true, then Vagrant will attempt to find a new port if it detects that the specified +port would collide with another VM. + +`config.vm.network` is a method which allows a static IP to be assigned to a VM via +host only networking. This is a large enough topic that it has its own page. Please +read the page on host only networking for more information and details. + `config.vm.project_directory` tells Vagrant where to mount the current project directory as a shared folder withing the new virtual machine's file system. @@ -248,4 +253,4 @@ config.chef.run_list = ["recipe[foo]", "recipe[bar]"] # Using the helpers config.chef.add_recipe("foo") config.chef.add_role("bar") -{% endhighlight %} \ No newline at end of file +{% endhighlight %}