Skip to content

Commit

Permalink
Add Vagrant options && bump version requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-o committed Sep 14, 2018
1 parent 3797fc4 commit e16f28c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 17 additions & 11 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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']}",
Expand Down
4 changes: 3 additions & 1 deletion config/devconfig.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit e16f28c

Please sign in to comment.