-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
56 lines (45 loc) · 1.64 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
#setup some needed parameters
settings = YAML.load_file 'settings.yaml'
user = settings['user']
username = "vagrant"
Vagrant.configure("2") do |config|
config.vm.box = "eduardiazf/base-vbox"
# config.vm.network "public_network", ip: "10.0.0.99", bridge: ["en0: Wi-Fi"]
config.vm.disk :disk, size: "60GB", primary: true
config.vm.provision "file", source: "./setup", destination: "/home/vagrant/setup"
config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end
config.vm.provider :virtualbox do |v, override|
v.customize ["modifyvm", :id, "--cpus", settings["vm"]["cpus"]]
end
config.vm.provider :virtualbox do |v, override|
v.customize ["modifyvm", :id, "--memory", settings["vm"]["memory"]]
end
config.vm.provision "shell" do |s|
s.privileged = false
s.name = "Setup Script"
s.inline = "sudo -u vagrant /bin/bash /home/vagrant/setup/do_setup.sh"
s.env = {
"USERNAME": user["name"],
"EMAIL": user["email"]
}
end
if settings["syncfolders"]
settings["syncfolders"].each do |sf|
config.vm.synced_folder sf["host"], sf["guest"], type: sf["type"],
ssh_opts_append: "-o Compression=yes -o CompressionLevel=5",
sshfs_opts_append: "-o auto_cache -o cache_timeout=115200",
disabled: false
end
end
if settings["forwardedports"]
settings["forwardedports"].each do |fp|
config.vm.network "forwarded_port", guest: fp["guest"], host: fp["host"], auto_correct: true, protocol: "tcp"
end
end
end