Add a switch environment var to disable GUI components.
Also disables requiring VESPA_VAGRANT_VM_BOX_URL to allow
using boxes from Vagrant cloud.
# -*- mode: ruby -*-
# vi: set ft=ruby :
+disable_gui = ENV['VESPA_DISABLE_VAGRANT_GUI']
def validate_vm_env_option(name)
opt = ENV[name]
@@ -10,16 +11,18 @@ def validate_vm_env_option(name)
end
validate_vm_env_option('VESPA_VAGRANT_VM_BOX')
-validate_vm_env_option('VESPA_VAGRANT_VM_BOX_URL')
-
vm_box = ENV['VESPA_VAGRANT_VM_BOX']
+
+unless disable_gui
+ validate_vm_env_option('VESPA_VAGRANT_VM_BOX_URL')
vm_box_url = ENV['VESPA_VAGRANT_VM_BOX_URL']
+end
# For a complete reference, please see the online documentation at https://docs.vagrantup.com.
Vagrant.configure("2") do |config|
config.vm.box = vm_box
- config.vm.box_url = vm_box_url
+ config.vm.box_url = vm_box_url unless disable_gui
config.ssh.forward_agent = true
@@ -27,7 +30,7 @@ Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
- vb.gui = true
+ vb.gui = true unless disable_gui
vb.name = "vespa-dev"
vb.memory = "8192"
@@ -52,9 +55,13 @@ Vagrant.configure("2") do |config|
yum-builddep -y /vagrant/dist/vespa.spec
echo -e "* soft nproc 409600\n* hard nproc 409600" > /etc/security/limits.d/99-nproc.conf
echo -e "* soft nofile 262144\n* hard nofile 262144" > /etc/security/limits.d/99-nofile.conf
+
+ unless disable_gui
echo -e "fs.inotify.max_user_watches = 524288" > /etc/sysctl.d/clion.conf
wget -q -O - https://download.jetbrains.com/cpp/CLion-2017.3.3.tar.gz | tar -C /opt -zx
ln -sf /opt/clion-2017.3.3/bin/clion.sh /usr/bin/clion
+ end
+
yum update -y
hostname localhost
SHELL
