-
Notifications
You must be signed in to change notification settings - Fork 15
/
Vagrantfile
63 lines (52 loc) · 1.76 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
57
58
59
60
61
62
63
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
# Allow host platform checks
# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
end
def OS.unix?
!OS.windows?
end
def OS.linux?
OS.unix? and not OS.mac?
end
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# vagrant-hostmanager plugin is required
unless Vagrant.has_plugin?("vagrant-hostmanager")
raise 'vagrant-hostmanager is not installed. run: vagrant plugin install vagrant-hostmanager'
end
# vagrant-hostsupdater plugin is required
unless Vagrant.has_plugin?("vagrant-hostsupdater")
raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater'
end
# vagrant-vbguest plugin is required
unless Vagrant.has_plugin?("vagrant-vbguest")
raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest'
end
config.vm.define "pykcdevel" do |pykcdevel|
pykcdevel.vm.box = "debian/jessie64"
pykcdevel.vm.hostname = "pythonkc.devel"
pykcdevel.vm.network "private_network", type: "dhcp"
if OS.unix?
pykcdevel.vm.synced_folder "./", "/vagrant/", type: "nfs"
elsif OS.windows?
pykcdevel.vm.synced_folder "./", "/vagrant/", type: "smb"
else
raise 'Unknown host operating system. Cannot continue.'
end
pykcdevel.vm.provider "virtualbox" do |vb|
vb.name = "pykcdevel"
vb.memory = 512
vb.cpus = 2
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"]
end
pykcdevel.vm.provision :shell, :path => "provision.sh"
end
end