33
44VAGRANTFILE_API_VERSION = "2"
55
6+ # Allow host platform checks
7+ # http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps
8+ module OS
9+ def OS . windows?
10+ ( /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM ) != nil
11+ end
12+
13+ def OS . mac?
14+ ( /darwin/ =~ RUBY_PLATFORM ) != nil
15+ end
16+
17+ def OS . unix?
18+ !OS . windows?
19+ end
20+
21+ def OS . linux?
22+ OS . unix? and not OS . mac?
23+ end
24+ end
25+
626Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
727
828 # vagrant-hostmanager plugin is required
@@ -15,13 +35,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
1535 raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater'
1636 end
1737
38+ # vagrant-vbguest plugin is required
39+ unless Vagrant . has_plugin? ( "vagrant-vbguest" )
40+ raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest'
41+ end
42+
1843 config . vm . define "pykcdotdev" do |pykcdotdev |
1944 pykcdotdev . vm . box = "debian/jessie64"
2045 pykcdotdev . vm . hostname = "pythonkc.dev"
2146 pykcdotdev . vm . network "private_network" , ip : "192.168.100.101"
22- pykcdotdev . vm . synced_folder "./" , "/vagrant/"
23- pykcdotdev . vm . synced_folder "./pythonkc_site" , "/var/www/pythonkc_site"
24- # TODO: Create a synced folder location for Ansible playbooks
47+ if OS . unix?
48+ pykcdotdev . vm . synced_folder "./" , "/vagrant/" , type : "nfs"
49+ elsif OS . windows?
50+ pykcdotdev . vm . synced_folder "./" , "/vagrant/" # , type: "smb"
51+ else
52+ raise 'Unknown host operating system. Cannot continue.'
53+ end
2554
2655 pykcdotdev . vm . provider "virtualbox" do |vb |
2756 vb . name = "pykcdotdev"
0 commit comments