Advertisement
Guest User

Untitled

a guest
Jul 24th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
  5. VAGRANTFILE_API_VERSION = "2"
  6.  
  7. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  8.  
  9. # =============================================== #
  10. # The box that will be used for this VM #
  11. # =============================================== #
  12.  
  13. config.vm.box = "bento/ubuntu-16.04"
  14.  
  15. # =============================================== #
  16. # Provider settings #
  17. # =============================================== #
  18.  
  19. config.vm.provider "virtualbox" do |v|
  20. v.memory = 2048
  21. v.cpus = 2
  22. v.name = "HMS ES6"
  23. end
  24.  
  25. # =============================================== #
  26. # Netwrok settings #
  27. # =============================================== #
  28.  
  29. config.vm.hostname = "ansible"
  30. config.vm.network "private_network", ip: "192.168.50.218"
  31. # config.vm.network "forwarded_port", guest: 80, host: 80
  32. config.vm.network "forwarded_port", guest: 8080, host: 8080
  33. config.vm.network "forwarded_port", guest: 3306, host: 33060
  34. config.vm.network "forwarded_port", guest: 22, host: 22
  35.  
  36. # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
  37. config.vm.define :int do |name|
  38. end
  39.  
  40. # =============================================== #
  41. # Shared folders #
  42. # ===============================================
  43.  
  44. #config.vm.synced_folder "../shared_folders/share", "/home/vagrant/share"
  45. #config.vm.synced_folder "../www", "/var/www/lt-nfs", type: "nfs"
  46.  
  47. # =============================================== #
  48. # SSH settings #
  49. # =============================================== #
  50.  
  51. config.ssh.username = "vagrant"
  52. config.ssh.password = "vagrant"
  53.  
  54. # =============================================== #
  55. # Provisioning #
  56. # =============================================== #
  57.  
  58. #config.vm.provision "ansible" do |ansible|
  59. #ansible.playbook = "playbook.yml"
  60. #end
  61.  
  62. config.vm.provision "shell", privileged: false, inline: <<-SHELL
  63. echo "Provisioning Virtual Machine..."
  64. sudo apt-get update
  65.  
  66. echo "Installing developer packages..."
  67. sudo apt-get install build-essential curl vim -y > /dev/null
  68.  
  69. echo "Installing Git..."
  70. sudo apt-get install git -y > /dev/null
  71.  
  72. echo "Installing Node and NVM..."
  73. curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
  74. source ~/.nvm/nvm.sh
  75. nvm install node
  76. nvm alias default node
  77.  
  78. cd /vagrant
  79.  
  80. echo "Installing Node dependencies..."
  81. npm install -g webpack
  82. npm install
  83. npm shrinkwrap --dev
  84. SHELL
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement