Skip to content

Instantly share code, notes, and snippets.

@kpettijohn
Created August 14, 2014 06:21
Show Gist options
  • Save kpettijohn/dac58828788a6a0fdfce to your computer and use it in GitHub Desktop.
Save kpettijohn/dac58828788a6a0fdfce to your computer and use it in GitHub Desktop.
Create multiple Vagrant boxes from one Vagranfile
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
boxes = [
{ :name => "zoo1", :ip => "10.10.10.35" },
{ :name => "zoo2", :ip => "10.10.10.36" },
{ :name => "zoo3", :ip => "10.10.10.37" },
{ :name => "zoo4", :ip => "10.10.10.38" },
{ :name => "zoo5", :ip => "10.10.10.39" }
]
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.box = "base"
config.vm.box_url = "../base.box"
config.vm.network "private_network", ip: opts[:ip]
config.vm.provider "vmware_workstation" do |v|
v.vmx["memsize"] = "1024"
v.vmx["numvcpus"] = "1"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment