From e54e53432f17623d94a99931c1000e0fb0c06de3 Mon Sep 17 00:00:00 2001 From: Logan Cox Date: Wed, 18 Mar 2015 23:42:59 -0500 Subject: [PATCH 1/4] updates to make it work with phusion/ubuntu-14.04-amd64 base box and vmware fusion provider --- Vagrantfile | 8 ++++++++ bootstrap.sh | 1 + 2 files changed, 9 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index a52756a..30b8643 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,6 +23,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.customize ["modifyvm", :id, "--cpus", "2"] end + config.vm.provider "vmware_fusion" do |v, override| + override.vm.box = "phusion/ubuntu-14.04-amd64" + override.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vmwarefusion.box" + + v.vmx["memsize"] = "3000" + v.vmx["numvcpus"] = "2" + end + home_dir = "/home/vagrant" config.vm.provision :shell, :path => "bootstrap.sh", :args => home_dir diff --git a/bootstrap.sh b/bootstrap.sh index 9119a70..5c5cb3b 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -21,6 +21,7 @@ apt-get -y install build-essential automake libtool apt-get -y install git vim # Java (Oracle) +sudo apt-get install -y software-properties-common sudo apt-get install -y python-software-properties sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update From 8290949c8924cd3cc3fdf9739a538270ab374f93 Mon Sep 17 00:00:00 2001 From: Logan Cox Date: Wed, 18 Mar 2015 23:46:57 -0500 Subject: [PATCH 2/4] Revert "updates to make it work with phusion/ubuntu-14.04-amd64 base box and vmware fusion provider" This reverts commit e54e53432f17623d94a99931c1000e0fb0c06de3. --- Vagrantfile | 8 -------- bootstrap.sh | 1 - 2 files changed, 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 30b8643..a52756a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,14 +23,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.customize ["modifyvm", :id, "--cpus", "2"] end - config.vm.provider "vmware_fusion" do |v, override| - override.vm.box = "phusion/ubuntu-14.04-amd64" - override.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vmwarefusion.box" - - v.vmx["memsize"] = "3000" - v.vmx["numvcpus"] = "2" - end - home_dir = "/home/vagrant" config.vm.provision :shell, :path => "bootstrap.sh", :args => home_dir diff --git a/bootstrap.sh b/bootstrap.sh index 5c5cb3b..9119a70 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -21,7 +21,6 @@ apt-get -y install build-essential automake libtool apt-get -y install git vim # Java (Oracle) -sudo apt-get install -y software-properties-common sudo apt-get install -y python-software-properties sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update From 8d61a6b83ad864beb9abfb244f7abe4febe9a212 Mon Sep 17 00:00:00 2001 From: Logan Cox Date: Thu, 22 Oct 2015 16:36:04 -0500 Subject: [PATCH 3/4] added some settings --- Vagrantfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 389f158..86e34c5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,6 +6,8 @@ VAGRANTFILE_API_VERSION = "2" $cpus = ENV.fetch("ISLANDORA_VAGRANT_CPUS", "2") $memory = ENV.fetch("ISLANDORA_VAGRANT_MEMORY", "3000") +$hostname = ENV.fetch("ISLANDORA_VAGRANT_HOSTNAME", "islandora") +$forward = ENV.fetch("ISLANDORA_VAGRANT_FORWARD", "TRUE") Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # All Vagrant configuration is done here. The most common configuration @@ -14,15 +16,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider "virtualbox" do |v| v.name = "Islandora 7.x-1.x Development VM" end - config.vm.hostname = "islandora" + config.vm.hostname = $hostname # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "islandora/islandora-base" + +if $forward.eql? "TRUE" then + config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache +end + config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--memory", $memory] vb.customize ["modifyvm", :id, "--cpus", $cpus] From 0c83d8193f4351c1a2da771f9472a24fb9f9fdb3 Mon Sep 17 00:00:00 2001 From: Logan Cox Date: Tue, 9 Feb 2016 23:58:10 -0600 Subject: [PATCH 4/4] clarifying portforwarding logic and adding docs --- README.md | 26 ++++++++++++++++++++++---- Vagrantfile | 13 ++++++------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cd80418..782ea9a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,19 @@ The is a development environment virtual machine for Islandora 7.x-1.x. It should work on any operating system that supports VirtualBox and Vagrant. +N.B. This virtual machine **should not** be used in production. + + +## Requirements + +1. [VirtualBox](https://www.virtualbox.org/) +2. [Vagrant](http://www.vagrantup.com/) + + +## Variables + +### System Resources + By default the virtual machine that is built uses 3GB of RAM. Your host machine will need to be able to support that. You can override the CPU and RAM allocation by creating `ISLANDORA_VAGRANT_CPUS` and `ISLANDORA_VAGRANT_MEMORY` environment variables and setting the values. For example, on an Ubuntu host you could add to `~/.bashrc`: ```bash @@ -11,12 +24,17 @@ export ISLANDORA_VAGRANT_CPUS=4 export ISLANDORA_VAGRANT_MEMORY=4096 ``` -N.B. This virtual machine **should not** be used in production. +### Hostname and Port Forwarding + +If you use a DNS or host file management plugin with Vagrant, you may want to set a specific hostname for the virtual machine and disable port forwarding. You can do that with the `ISLANDORA_VAGRANT_HOSTNAME` and `ISLANDORA_VAGRANT_FORWARD` variables. For example: + +```bash +export ISLANDORA_VAGRANT_HOSTNAME="islandora.vagrant.test" +export ISLANDORA_VAGRANT_FORWARD="FALSE" +``` + -## Requirements -1. [VirtualBox](https://www.virtualbox.org/) -2. [Vagrant](http://www.vagrantup.com/) ## Use diff --git a/Vagrantfile b/Vagrantfile index 86e34c5..d110ac7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,19 +16,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider "virtualbox" do |v| v.name = "Islandora 7.x-1.x Development VM" end + config.vm.hostname = $hostname # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "islandora/islandora-base" -if $forward.eql? "TRUE" then - - config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat - config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL - config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache - -end + unless $forward.eql? "FALSE" + config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat + config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL + config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache + end config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--memory", $memory]