Skip to content

Commit

Permalink
Allows recipes to be run without Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Jan 22, 2013
1 parent 8b4dd5e commit 111da17
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Vagrantfile
@@ -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"
Expand All @@ -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
11 changes: 11 additions & 0 deletions solo.json
@@ -0,0 +1,11 @@
{
"run_list": [
"recipe[apt]",
"recipe[ckan]"
],
"user": "vagrant",
"postgresql": {
"version": "9.1",
"ssl": false
}
}
4 changes: 4 additions & 0 deletions solo.rb
@@ -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.