With Vagrant, each folder and Vagrantfile represents a separate project. If you want to launch multiple copies of the same setup, you’ll need to duplicate the project. If your project needs multiple droplets (e.g. separate web and database servers), you can use a Vagrant multi-machine environment. For instance, this would create two different droplets, one named “db” and one named “web.”
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'digital_ocean'
config.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
config.ssh.private_key_path = '/path/to/id_rsa'
config.vm.define "db" do |db|
config.vm.provider :digital_ocean do |provider|
provider.token = 'YOUR_DO_TOKEN'
provider.image = 'ubuntu-14-04-x64'
provider.region = 'nyc3'
provider.size = '512mb'
provider.ssh_key_name = 'key_name'
end
end
config.vm.define "web" do |web|
config.vm.provider :digital_ocean do |provider|
provider.token = 'YOUR_DO_TOKEN'
provider.image = 'ubuntu-14-04-x64'
provider.region = 'nyc3'
provider.size = '512mb'
provider.ssh_key_name = 'key_name'
end
end
end