From 7261af238bdd4dfdf87273ecbdb357a78d6937c9 Mon Sep 17 00:00:00 2001 From: Theo Ouzhinski Date: Mon, 10 Sep 2018 21:44:31 -0400 Subject: [PATCH] Add Vagrant options && bump version requirement --- Vagrantfile | 28 +++++++++++++++++----------- config/devconfig.json.sample | 4 +++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 97bf9acc21a..0c6568ff613 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,7 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.require_version ">= 1.8.4" +Vagrant.require_version ">= 2.1.0" require "json" require "time" @@ -35,16 +35,18 @@ def setup_host end # Make sure the host computer is set up every time a vagrant command is run -setup_host - +if devconfig["use_vpn"] + setup_host +end -VAGRANTFILE_API_VERSION = "2" -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| +Vagrant.configure("2") do |config| config.vm.box = "ubuntu/xenial64" config.vm.box_version = "20171110.0.0" config.vm.boot_timeout = 1000 - config.vm.network "public_network", bridge: devconfig["network_interface"] + if devconfig["use_vpn"] + config.vm.network "public_network", bridge: devconfig["network_interface"] + end config.vm.network "forwarded_port", guest: 8080, host: 8080 config.ssh.forward_agent = true @@ -66,18 +68,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.network :private_network, ip: '192.168.50.50' - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.synced_folder ".", "/vagrant-nfs", type: :nfs + if devconfig["use_nfs"] + config.vm.synced_folder ".", "/vagrant", type: :nfs, nfs_udp: false + config.nfs.map_uid = Process.uid + config.nfs.map_gid = Process.gid + else + config.vm.synced_folder ".", "/vagrant" + end + config.bindfs.default_options = { force_user: 'ubuntu', force_group: 'ubuntu', perms: 'u=rwX:g=rD:o=rD' } - config.bindfs.bind_folder "/vagrant-nfs", "/home/ubuntu/intranet", + config.bindfs.bind_folder "/vagrant", "/home/ubuntu/intranet", force_user: 'ubuntu', force_group: 'ubuntu' - config.nfs.map_uid = Process.uid - config.nfs.map_gid = Process.gid config.vm.provision "file", source: "~/.ssh/#{devconfig['ssh_key']}", diff --git a/config/devconfig.json.sample b/config/devconfig.json.sample index a8eaf73d20c..ea1d45a6290 100644 --- a/config/devconfig.json.sample +++ b/config/devconfig.json.sample @@ -3,5 +3,7 @@ "email": "1761tjeffers@tjhsst.edu", "ssh_key": "id_rsa", "ldap_simple_bind_password": "password", - "sql_password": "pwd" + "sql_password": "pwd", + "use_nfs": true, + "use_vpn": false }