Skip to content

Instantly share code, notes, and snippets.

@64lines
Created August 25, 2017 14:50
Show Gist options
  • Select an option

  • Save 64lines/f3a6612cdcc305951c850b781b30cf40 to your computer and use it in GitHub Desktop.

Select an option

Save 64lines/f3a6612cdcc305951c850b781b30cf40 to your computer and use it in GitHub Desktop.
[EDX][VAGRANT] - Vagrantfile
Vagrant.require_version ">= 1.5.3"
VAGRANTFILE_API_VERSION = "2"
MEMORY = 4096
CPU_COUNT = 2
# map the name of the git branch that we use for a release
# to a name and a file path, which are used for retrieving
# a Vagrant box from the internet.
openedx_releases = {
"open-release/eucalyptus.master" => {
:name => "eucalyptus-fullstack-2016-08-25", :file => "eucalyptus-fullstack-2016-08-25.box",
},
"open-release/eucalyptus/1rc1" => {
:name => "eucalyptus-fullstack-1rc1", :file => "eucalyptus-fullstack-2016-08-19.box",
},
"open-release/eucalyptus.1rc2" => {
:name => "eucalyptus-fullstack-2016-08-19", :file => "eucalyptus-fullstack-2016-08-19.box",
},
"open-release/eucalyptus.1" => {
:name => "eucalyptus-fullstack-2016-08-25", :file => "eucalyptus-fullstack-2016-08-25.box",
},
# Note: the devstack and fullstack boxes differ, because devstack had an issue
# that needed fixing, but it didn't affect fullstack.
"named-release/dogwood" => {
:name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
},
"named-release/dogwood.1" => {
:name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
},
"named-release/dogwood.2" => {
:name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
},
"named-release/dogwood.3" => {
:name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
},
"named-release/dogwood.rc" => {
:name => "dogwood-fullstack-rc2", :file => "20151221-dogwood-fullstack-rc2.box",
},
# Cypress is deprecated and unsupported
# "named-release/cypress" => {
# :name => "cypress-fullstack", :file => "cypress-fullstack.box",
# },
# Birch is deprecated and unsupported
# "named-release/birch.2" => {
# :name => "birch-fullstack-2", :file => "birch-2-fullstack.box",
# },
}
openedx_releases.default = {
:name => "eucalyptus-fullstack-2016-08-25", :file => "eucalyptus-fullstack-2016-08-25.box",
}
rel = ENV['OPENEDX_RELEASE']
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Creates an edX fullstack VM from an official release
config.vm.box = openedx_releases[rel][:name]
config.vm.box_url = "http://files.edx.org/vagrant-images/#{openedx_releases[rel][:file]}"
config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: false
config.vm.network :forwarded_port, guest: 18010, host: 8081, auto_correct: false
config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.insert_key = true
config.vm.network :private_network, ip: "192.168.33.10"
config.hostsupdater.aliases = ["preview.localhost"]
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment