Permalink
Browse files

Allows recipes to be run without Vagrant

  • Loading branch information...
1 parent 8b4dd5e commit 111da173865373e3effb8aacb02d105d90a0c103 @vitorbaptista committed Jan 22, 2013
Showing with 24 additions and 8 deletions.
  1. +9 −8 Vagrantfile
  2. +11 −0 solo.json
  3. +4 −0 solo.rb
View
@@ -1,6 +1,9 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
+root = File.expand_path("..", __FILE__)
+chef_json = File.join(root, "solo.json")
+
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
@@ -20,14 +23,12 @@ Vagrant::Config.run do |config|
config.vm.forward_port 5000, 5000
config.vm.provision :chef_solo do |chef|
- chef.json = {
- "user" => "vagrant",
- "postgresql" => {
- "ssl" => false
- }
- }
- chef.add_recipe("apt")
- chef.add_recipe("ckan")
+ chef.cookbooks_path = "cookbooks"
+ chef.json = JSON.parse(File.read(chef_json))
+ chef.json["user"] = "vagrant"
+ chef.json["run_list"].each do |recipe|
+ chef.add_recipe recipe
+ end
end
end
View
@@ -0,0 +1,11 @@
+{
+ "run_list": [
+ "recipe[apt]",
+ "recipe[ckan]"
+ ],
+ "user": "vagrant",
+ "postgresql": {
+ "version": "9.1",
+ "ssl": false
+ }
+}
View
@@ -0,0 +1,4 @@
+root = File.expand_path(File.dirname(__FILE__))
+
+file_cache_path root
+cookbook_path root + '/cookbooks'

0 comments on commit 111da17

Please sign in to comment.