This repository was archived by the owner on Feb 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVagrantfile
More file actions
66 lines (58 loc) · 1.94 KB
/
Vagrantfile
File metadata and controls
66 lines (58 loc) · 1.94 KB
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
57
58
59
60
61
62
63
64
65
66
Vagrant.configure(2) do |config|
# Collect data about the host
case RbConfig::CONFIG["host_os"]
when /cygwin|mswin|msys|mingw|bccwin|wince|emc|emx|windows/i
# Windows
cpus = `wmic cpu get NumberOfLogicalProcessors`.split("\n")[2].to_i
when /linux|arch/i
# linux
cpus = `nproc`.to_i
when /darwin|mac os/i
# MacOS
cpus = `sysctl -n hw.ncpu`.to_i
else
# Others...
cpus = 2
end
config.vm.define "Neap Box" do |node|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# General configuration
node.vm.hostname = "box.neap.dev"
node.vm.box = "debian/contrib-jessie64"
node.vm.box_version = ">= 8.7.0"
# Synced folder configuration
node.vm.synced_folder ".", "/vagrant"
# VirtualBox provider
node.vm.provider "virtualbox" do |vb|
# System configuration
vb.name = "Neap Box"
vb.cpus = cpus
vb.memory = "1024"
vb.customize [
"modifyvm", :id,
"--groups", "/Neap",
]
end
# VirtualBox Guest update
node.vbguest.auto_update = true
node.vbguest.installer = DebianVbguest
node.vbguest.no_remote = true
# Provisioning script
node.vm.provision "shell" do |s|
s.inline = "/vagrant/bootstrap.sh | tee /vagrant/bootstrap.log"
s.keep_color = true
end
end
end
class DebianVbguest < VagrantVbguest::Installers::Debian
def install(opts=nil, &block)
communicate.sudo("apt-get -yq purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11", opts, &block)
@vb_uninstalled = true
super
end
def running?(opts=nil, &block)
return false if @vb_uninstalled
super
end
end