Guest User

Untitled

a guest
Feb 26th, 2018
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Vagrant.configure("2") do |config|
  2. # config.ssh.password is needed for the first time only.
  3. # config.ssh.* could be commented out after vagrant has replaced insecure key-pair with generated key-pair.
  4. config.ssh.username = "vagrant"
  5. config.ssh.password = "vagrant"
  6.  
  7. config.vm.box = "debian93docker"
  8.  
  9. ######
  10. # You need to prepare some VirtualBox's network configuration as follows, or manually.
  11. # (I prefer manually.)
  12. #
  13. #config.vm.provider "virtualbox" do |vbox|
  14. # vbox.customize ["natnetwork", "add", "--netname", "incubator", "--network", "192.168.77.0/24"]
  15. #end
  16.  
  17. multiple_vm(config, "node01")
  18. multiple_vm(config, "node02")
  19. end
  20.  
  21. def multiple_vm(cfg, vmname)
  22. cfg.vm.define vmname do |node|
  23. node.vm.provider "virtualbox" do |vbox|
  24. vbox.name = vmname
  25. vbox.customize ["modifyvm", vmname, "--nic2", "natnetwork", "--nat-network2", "incubator"]
  26. end
  27. node.vm.hostname = vmname
  28. end
  29. cfg.vm.provision "shell", path: "activate-nic2-with-debian93minimal.sh"
  30. end
Add Comment
Please, Sign In to add comment