Skip to content

Instantly share code, notes, and snippets.

@Piusha
Last active September 28, 2017 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Piusha/b0758e86b38556728feb7c178c298af0 to your computer and use it in GitHub Desktop.
Save Piusha/b0758e86b38556728feb7c178c298af0 to your computer and use it in GitHub Desktop.
Multiple vagrant box deployment
Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: "echo Multiple vagrant box deployment"
config.vm.box = "bento/ubuntu-16.04"
# Customize the amount of memory on the VM:
config.vm.provider :virtualbox do |vb|
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.define "web_node" do |web_node|
web_node.vm.box = "web_node"
web_node.vm.network :private_network, ip: '10.10.10.200'
web_node.vm.synced_folder "../apps", "/web", :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=770', 'fmode=770']
end
config.vm.define "db_node" do |db_node|
db_node.vm.box = "db_node"
db_node.vm.network :private_network, ip: '10.10.10.201'
db_node.vm.synced_folder "../apps", "/web", :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=770', 'fmode=770']
end
config.vm.define "es_node" do |es_node|
es_node.vm.box = "es_node"
es_node.vm.network :private_network, ip: '10.10.10.202'
es_node.vm.synced_folder "../apps", "/web", :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=770', 'fmode=770']
end
config.vm.define "redis_node" do |redis_node|
redis_node.vm.box = "redis_node"
redis_node.vm.network :private_network, ip: '10.10.10.203'
redis_node.vm.synced_folder "../apps", "/web", :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=770', 'fmode=770']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment