diff --git a/_layouts/documentation.html b/_layouts/documentation.html index 55abd090d..9d52d6d6b 100644 --- a/_layouts/documentation.html +++ b/_layouts/documentation.html @@ -8,6 +8,7 @@
  • Provisioners diff --git a/docs/provisioners/chef_solo.md b/docs/provisioners/chef_solo.md index 1c6b63232..4bff8bf33 100644 --- a/docs/provisioners/chef_solo.md +++ b/docs/provisioners/chef_solo.md @@ -34,7 +34,7 @@ various cookbooks. To tell Vagrant what the cookbook path is, set it up in your Vagrantfile, like so: {% highlight ruby %} -Vagrant::Configure.run do |config| +Vagrant::Config.run do |config| # This path will be expanded relative to the project directory config.chef.cookbooks_path = "cookbooks" end @@ -48,7 +48,7 @@ end directory, and chef solo will then look in every directory for the cookbooks. {% highlight ruby %} -Vagrant::Configure.run do |config| +Vagrant::Config.run do |config| config.chef.cookbooks_path = ["cookbooks", "~/company/cookbooks"] end {% endhighlight %} @@ -130,7 +130,7 @@ But sometimes, cookbooks need additional, custom JSON configuration. For this you can specify additional JSON data in the Vagrantfile: {% highlight ruby %} -Vagrant::Configure.run do |config| +Vagrant::Config.run do |config| # merge is used to preserve the default JSON configuration, otherwise it'll # all be overwritten config.chef.json.merge!({ @@ -148,7 +148,7 @@ to a directory containing these role files, and these roles can then be used by chef solo run list. An example of configuring roles is shown below: {% highlight ruby %} -Vagrant::Configure.run do |config| +Vagrant::Config.run do |config| # The roles path will be expanded relative to the project directory config.chef.roles_path = "roles" config.chef.add_role("web") @@ -163,7 +163,7 @@ and this should be fine for most users. But in the case that you need to customi the location, you can do so in the Vagrantfile: {% highlight ruby %} -Vagrant::Configure.run do |config| +Vagrant::Config.run do |config| config.chef.provisioning_path = "/tmp/vagrant-chef" end {% endhighlight %} diff --git a/docs/provisioners/chef_solo_remote.md b/docs/provisioners/chef_solo_remote.md new file mode 100644 index 000000000..109c331dc --- /dev/null +++ b/docs/provisioners/chef_solo_remote.md @@ -0,0 +1,70 @@ +--- +layout: documentation +title: Documentation - Provisioners - Chef Solo (Remote) +--- +# Chef Solo Provisioning (Remote) + +**Before reading this page, be sure to read the [chef solo provisioning](/docs/provisioners/chef_solo.html).** + +[Chef Solo](http://wiki.opscode.com/display/chef/Chef+Solo) also allows for an additional option +of downloading packaged (`tar.gz`) cookbooks from a remote URL to provision. This is a bit more +complicated than using a local cookbooks path (covered in the chef solo provisioning documentation), +but is less complicated than setting up a full blown chef server. + +Prior to reading this page, it is recommend that you spend a few minutes reading about +[running chef solo from a URL](http://wiki.opscode.com/display/chef/Chef+Solo#ChefSolo-RunningfromaURL). +This will allow you to familiarize yourself with the terms used throughout the rest of +this page. + +## Setting the Recipe URL + +The first step is specify the recipe URL in the Vagrantfile. This is the URL from +which chef solo will download the cookbooks. The Vagrantfile below shows how this is +done: + +{% highlight ruby %} +Vagrant::Config.run do |config| + config.vm.provisioner = :chef_solo + config.chef.recipe_url = "http://files.vagrantup.com/getting_started/cookbooks.tar.gz" +end +{% endhighlight %} + +## Setting the Cookbooks Path + +Next, you must specify the paths within the downloaded package where the cookbooks +are. By default, Vagrant assumes they're in a top-level "cookbooks" directory within +the package, but sometimes you may include other directories, such as "site-cookbooks" +which you must manually specify. + +To tell Vagrant what the cookbook path is, you use the same `config.chef.cookbooks_path` +setting, but with a little extra formatting to let Vagrant know you're describing a +path on the VM, and not on the host machine. + +{% highlight ruby %} +Vagrant::Config.run do |config| + config.chef.cookbooks_path = [:vm, "cookbooks"] +end +{% endhighlight %} + +You may also use an array to specify multiple cookbook paths. + +
    +

    Mixing Host and VM Cookbook Paths

    +

    + You can also mix together host and VM cookbook paths. This allows + you to use some cookbooks from a remote location, and some from a + local directory. An example of this is shown below: + +{% highlight ruby %} +Vagrant::Config.run do |config| + config.chef.cookbooks_path = ["local-cookbooks", [:vm, "cookbooks"]] +end +{% endhighlight %} +

    +
    + +## Enabling and Executing + +Now that everything is setup, provisioning the VM is the same as always: if you're +building the VM from scratch, just run `vagrant up`. Otherwise, run `vagrant reload` +to simply restart the VM, provisioning in the process.