diff --git a/Vagrantfile b/Vagrantfile index 1e4290a..11f119f 100644 --- a/Vagrantfile +++ b/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" @@ -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 diff --git a/solo.json b/solo.json new file mode 100644 index 0000000..a90db6c --- /dev/null +++ b/solo.json @@ -0,0 +1,11 @@ +{ + "run_list": [ + "recipe[apt]", + "recipe[ckan]" + ], + "user": "vagrant", + "postgresql": { + "version": "9.1", + "ssl": false + } +} diff --git a/solo.rb b/solo.rb new file mode 100644 index 0000000..00220e4 --- /dev/null +++ b/solo.rb @@ -0,0 +1,4 @@ +root = File.expand_path(File.dirname(__FILE__)) + +file_cache_path root +cookbook_path root + '/cookbooks'