2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

Use chef-solo to install phantomjs into Vagrant VM.

This introduces two configuration management runs into the
Vagrant provisioning phase. The first chef-solo run ensures that
a current version of chef is installed using the omnibus updater.
The second chef-solo run installs vim and phantomjs.

Much more is possible, this is a proof of concept.
Cookbooks are stored in the chef directory, and managed by
librarian-chef, which is like a bundler for cookbooks.

Chef is run when VM is first downloaded and booted, but not on
subsequent halt/up cycles. To force chef to run again, use
`vagrant provision`.
This commit is contained in:
Elliot Murphy 2013-02-07 14:09:57 -05:00
parent 9e198c3ac5
commit f3bcbd8bc3
65 changed files with 2966 additions and 4 deletions

22
Vagrantfile vendored
View file

@ -26,4 +26,26 @@ Vagrant::Config.run do |config|
config.vm.forward_port 1080, 4080 # Mailcatcher
config.vm.share_folder("v-root", "/vagrant", ".")
chef_cookbooks_path = ["chef/cookbooks"]
# The first chef run just upgrades the chef installation using omnibus
config.vm.provision :chef_solo do |chef|
chef.binary_env = "GEM_HOME=/opt/vagrant_ruby/lib/ruby/gems/1.8/ GEM_PATH= "
chef.binary_path = "/opt/vagrant_ruby/bin/"
chef.cookbooks_path = chef_cookbooks_path
chef.add_recipe "recipe[omnibus_updater]"
chef.json = { :omnibus_updater => { 'version_search' => false }}
end
# The second chef run uses the updated chef-solo and does normal configuration
config.vm.provision :chef_solo do |chef|
chef.binary_env = "GEM_HOME=/opt/chef/embedded/lib/ruby/gems/1.9.1/ GEM_PATH= "
chef.binary_path = "/opt/chef/bin/"
chef.cookbooks_path = chef_cookbooks_path
chef.add_recipe "recipe[apt]"
chef.add_recipe "recipe[build-essential]"
chef.add_recipe "recipe[phantomjs]"
chef.add_recipe "recipe[vim]"
end
end