Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. VAGRANTFILE_API_VERSION = "2"
  5.  
  6. Vagrant.require_version ">= 1.9.1"
  7.  
  8. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  9.  
  10. config.vm.box = "bento/ubuntu-16.04"
  11.  
  12. # Configurate the virtual machine to use 2GB of RAM
  13. config.vm.provider :virtualbox do |vb|
  14. vb.customize ["modifyvm", :id, "--memory", "2048"]
  15. vb.name = "Nuggets_API_Env"
  16. end
  17.  
  18. # Forward the Rails server default port to the host
  19. config.vm.network :forwarded_port, guest: 3000, host: 3000
  20.  
  21. # Use Chef Solo to provision our virtual machine
  22. config.vm.provision :chef_solo do |chef|
  23. chef.cookbooks_path = ["cookbooks"]
  24.  
  25. chef.add_recipe "apt"
  26. chef.add_recipe "build-essential"
  27. chef.add_recipe "nodejs"
  28. chef.add_recipe "openssl"
  29. chef.add_recipe "ruby_build"
  30. chef.add_recipe "ruby_rbenv::user"
  31. chef.add_recipe "vim"
  32. chef.add_recipe "postgresql::config_initdb"
  33. chef.add_recipe "postgresql::server"
  34. chef.add_recipe "postgresql::client"
  35.  
  36. chef.json = {
  37. postgresql: {
  38. apt_pgdg_postgresql: true,
  39. version: "9.5",
  40. password: {
  41. postgres: "test1234",
  42. }
  43. },
  44. rbenv: {
  45. user_installs: [{
  46. user: 'vagrant',
  47. rubies: ["2.4.0"],
  48. global: "2.4.0",
  49. gems: {
  50. "2.4.0" => [
  51. { name: "bundler" }
  52. ]
  53. }
  54. }]
  55. },
  56. }
  57. end
  58.  
  59. config.vm.provision "shell" do |s|
  60. s.path = "VM_Local_Setup.sh"
  61. s.upload_path = "/vagrant/VM_Local_Setup.sh"
  62. s.privileged = false
  63. end
  64.  
  65. end
  66.  
  67. site "https://supermarket.getchef.com/api/v1"
  68.  
  69. cookbook 'apt'
  70. cookbook 'build-essential'
  71. cookbook 'nodejs'
  72. cookbook 'openssl'
  73. cookbook 'postgresql'
  74. cookbook 'ruby_build'
  75. cookbook 'ruby_rbenv'
  76. cookbook 'vim'
  77.  
  78. #!/bin/bash
  79.  
  80. sudo apt-get update
  81. sudo apt-get upgrade -y
  82. bundler install
  83. rbenv rehash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement