Advertisement
eduardoperezl

Vagrantfile

May 15th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. Vagrant.require_version ">= 1.5.3"
  2.  
  3. VAGRANTFILE_API_VERSION = "2"
  4.  
  5. MEMORY = 4096
  6. CPU_COUNT = 2
  7.  
  8. # map the name of the git branch that we use for a release
  9. # to a name and a file path, which are used for retrieving
  10. # a Vagrant box from the internet.
  11. openedx_releases = {
  12. "open-release/eucalyptus.master" => {
  13. :name => "eucalyptus-fullstack-2017-01-10", :file => "eucalyptus-fullstack-2017-01-10.box",
  14. },
  15. "open-release/eucalyptus/1rc1" => {
  16. :name => "eucalyptus-fullstack-1rc1", :file => "eucalyptus-fullstack-2016-08-19.box",
  17. },
  18. "open-release/eucalyptus.1rc2" => {
  19. :name => "eucalyptus-fullstack-2016-08-19", :file => "eucalyptus-fullstack-2016-08-19.box",
  20. },
  21. "open-release/eucalyptus.1" => {
  22. :name => "eucalyptus-fullstack-2016-08-25", :file => "eucalyptus-fullstack-2016-08-25.box",
  23. },
  24. "open-release/eucalyptus.2" => {
  25. :name => "eucalyptus-fullstack-2016-09-01", :file => "eucalyptus-fullstack-2016-09-01.box",
  26. },
  27. "open-release/eucalyptus.3" => {
  28. :name => "eucalyptus-fullstack-2017-01-10", :file => "eucalyptus-fullstack-2017-01-10.box",
  29. },
  30. # Note: the devstack and fullstack boxes differ, because devstack had an issue
  31. # that needed fixing, but it didn't affect fullstack.
  32. "named-release/dogwood" => {
  33. :name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
  34. },
  35. "named-release/dogwood.1" => {
  36. :name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
  37. },
  38. "named-release/dogwood.2" => {
  39. :name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
  40. },
  41. "named-release/dogwood.3" => {
  42. :name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
  43. },
  44. "named-release/dogwood.rc" => {
  45. :name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
  46. },
  47. # Cypress is deprecated and unsupported
  48. # "named-release/cypress" => {
  49. # :name => "cypress-fullstack", :file => "cypress-fullstack.box",
  50. # },
  51. # Birch is deprecated and unsupported
  52. # "named-release/birch.2" => {
  53. # :name => "birch-fullstack-2", :file => "birch-2-fullstack.box",
  54. # },
  55. }
  56. openedx_releases.default = {
  57. :name => "eucalyptus-fullstack-2017-01-10", :file => "eucalyptus-fullstack-2017-01-10.box",
  58. }
  59. rel = ENV['OPENEDX_RELEASE']
  60.  
  61. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  62.  
  63. # Creates an edX fullstack VM from an official release
  64. config.vm.box = openedx_releases[rel][:name]
  65. config.vm.box_url = "http://files.edx.org/vagrant-images/#{openedx_releases[rel][:file]}"
  66.  
  67. config.vm.synced_folder ".", "/vagrant", disabled: true
  68. config.ssh.insert_key = true
  69. config.ssh.forward_agent = true
  70.  
  71. config.vm.network :public_network, ip: "10.0.2.109"
  72. config.hostsupdater.aliases = ["preview.localhost"]
  73.  
  74. config.vm.provider :virtualbox do |vb|
  75. vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
  76. vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
  77.  
  78. # Allow DNS to work for Ubuntu 12.10 host
  79. # http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
  80. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  81. end
  82. config.ssh.username = "vagrant"
  83. config.ssh.password = "P7xorj$447"
  84. config.ssh.insert_key = false
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement