Commit 71570e08 by Ned Batchelder

Fullstack is now a native install, in Vagrant

parent 5bc47e50
Vagrant.require_version ">= 1.5.3" Vagrant.require_version ">= 1.8.7"
VAGRANTFILE_API_VERSION = "2" VAGRANTFILE_API_VERSION = "2"
MEMORY = 4096 MEMORY = 4096
CPU_COUNT = 2 CPU_COUNT = 2
vm_guest_ip = "192.168.33.10"
if ENV["VAGRANT_GUEST_IP"]
vm_guest_ip = ENV["VAGRANT_GUEST_IP"]
end
# These are versioning variables in the roles. Each can be overridden, first # These are versioning variables in the roles. Each can be overridden, first
# with OPENEDX_RELEASE, and then with a specific environment variable of the # with OPENEDX_RELEASE, and then with a specific environment variable of the
# same name but upper-cased. # same name but upper-cased.
...@@ -15,19 +20,24 @@ VERSION_VARS = [ ...@@ -15,19 +20,24 @@ VERSION_VARS = [
'forum_version', 'forum_version',
'xqueue_version', 'xqueue_version',
'demo_version', 'demo_version',
'NOTIFIER_VERSION',
'ECOMMERCE_VERSION',
'ECOMMERCE_WORKER_VERSION',
'PROGRAMS_VERSION',
] ]
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Creates a machine from a base Ubuntu 16.04 image for virtualbox
config.vm.box = "boxcutter/ubuntu1604"
config.vm.network :private_network, ip: vm_guest_ip, nic_type: "virtio"
config.ssh.insert_key = true config.ssh.insert_key = true
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.provider :virtualbox do |vb| config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s] vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
# You can adjust this to the amount of CPUs your system has available
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s] vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host # Allow DNS to work for Ubuntu 12.10 host
...@@ -41,8 +51,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -41,8 +51,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :ansible do |ansible| config.vm.provision :ansible do |ansible|
# point Vagrant at the location of your playbook you want to run # point Vagrant at the location of your playbook you want to run
ansible.playbook = "../../../playbooks/vagrant-fullstack.yml" ansible.playbook = "../../../playbooks/edx_sandbox.yml"
ansible.verbose = "vvv" ansible.verbose = "vv"
# Set extra-vars here instead of in the vagrant play so that # Set extra-vars here instead of in the vagrant play so that
# they are written out to /edx/etc/server-vars.yml which can # they are written out to /edx/etc/server-vars.yml which can
......
Vagrant.require_version ">= 1.5.3" Vagrant.require_version ">= 1.8.7"
VAGRANTFILE_API_VERSION = "2" VAGRANTFILE_API_VERSION = "2"
...@@ -41,15 +41,21 @@ openedx_releases = { ...@@ -41,15 +41,21 @@ openedx_releases = {
openedx_releases.default = "eucalyptus-fullstack-2016-09-01" openedx_releases.default = "eucalyptus-fullstack-2016-09-01"
openedx_release = ENV['OPENEDX_RELEASE'] openedx_release = ENV['OPENEDX_RELEASE']
boxname = ENV['OPENEDX_BOXNAME']
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
boxfile = ""
if not boxname
reldata = openedx_releases[openedx_release] reldata = openedx_releases[openedx_release]
if Hash == reldata.class if Hash == reldata.class
boxname = openedx_releases[openedx_release][:name] boxname = openedx_releases[openedx_release][:name]
boxfile = openedx_releases[openedx_release].fetch(:file, "#{boxname}.box") boxfile = openedx_releases[openedx_release].fetch(:file, "")
else else
boxname = reldata boxname = reldata
end
end
if boxfile == ""
boxfile = "#{boxname}.box" boxfile = "#{boxname}.box"
end end
...@@ -58,10 +64,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -58,10 +64,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}" config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}"
config.vm.box_check_update = false config.vm.box_check_update = false
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.insert_key = true config.ssh.insert_key = true
config.vm.network :private_network, ip: "192.168.33.10"
config.hostsupdater.aliases = ["preview.localhost"] config.hostsupdater.aliases = ["preview.localhost"]
config.vm.provider :virtualbox do |vb| config.vm.provider :virtualbox do |vb|
...@@ -71,5 +77,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -71,5 +77,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Allow DNS to work for Ubuntu 12.10 host # Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client # http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Virtio is faster, but the box needs to have support for it. We didn't
# have support in the boxes before Ficus.
if !(boxname.include?("dogwood") || boxname.include?("eucalyptus"))
vb.customize ['modifyvm', :id, '--nictype1', 'virtio']
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment