Skip to content

Instantly share code, notes, and snippets.

@jasherai
Created September 14, 2010 07:27
Show Gist options
  • Select an option

  • Save jasherai/578668 to your computer and use it in GitHub Desktop.

Select an option

Save jasherai/578668 to your computer and use it in GitHub Desktop.
Vagrant::Config.run do |config|
config.vm.define :jfdi_base do |jfdi_config|
#options = { :box_name => "jfdi_base" }
shared_config(jfdi_config, 'jfdi', '10.0.5.100')
end
end
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. For a detailed explanation
# and listing of configuration options, please view the documentation
# online.
# Gui mode option for debugging use
config.vm.boot_mode = "gui"
## VM Definitions
## Exclude list
excluded_vms=%w{ mediarush thinlayer }
## Load vms from vagrant files in include folder
%w{ chef_builder chef_server mr_base jfdi_base}.each do |v_file|
include_vagrantfile = File.expand_path(File.join(File.dirname(__FILE__), "include", "vagrantfiles", v_file))
load include_vagrantfile if File.exist?(include_vagrantfile)
end
def shared_config(config, name, ip_addr, options={})
config.vm.provisioner = :chef_solo
config.chef.roles_path = 'roles'
config.vm.box = options[:box_name].nil? ? "lucid32" : options[:box_name]
config.vm.network(ip_addr)
config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
config.chef.cookbooks_path = "cookbooks/#{name}"
config.chef.add_role name
config.chef.run_list.clear
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment