diff --git a/Vagrantfile b/Vagrantfile index e847659848..25b27302e1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,7 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.configure("1") do |config| +def v10(config) # All Vagrant configuration is done here. The most common configuration # options are documented and commented below. For a complete reference, # please see the online documentation at vagrantup.com. @@ -20,7 +20,7 @@ Vagrant.configure("1") do |config| # via the IP. Host-only networks can talk to the host machine as well as # any other machines on the same network, but cannot be accessed (through this # network interface) by any external networks. - # config.vm.network :hostonly, "192.168.33.10" + config.vm.network :hostonly, "192.168.33.10" # Assign this VM to a bridged network, allowing you to connect directly to a # network using the host's network device. This makes the VM appear as another @@ -34,6 +34,9 @@ Vagrant.configure("1") do |config| # Share an additional folder to the guest VM. The first argument is # an identifier, the second is the path on the guest to mount the # folder, and the third is the path on the host to the actual folder. + if not File.exist? File.expand_path '~/docker' + Dir.mkdir(File.expand_path '~/docker') + end config.vm.share_folder "v-data", "~/docker", "~/docker" # Enable provisioning with Puppet stand alone. Puppet manifests @@ -99,7 +102,15 @@ Vagrant.configure("1") do |config| # chef.validation_client_name = "ORGNAME-validator" end -Vagrant.configure("2") do |config| +"#{Vagrant::VERSION}" < "1.1.0" and Vagrant::Config.run do |config| + v10(config) +end + +"#{Vagrant::VERSION}" >= "1.1.0" and Vagrant.configure("1") do |config| + v10(config) +end + +"#{Vagrant::VERSION}" >= "1.1.0" and Vagrant.configure("2") do |config| config.vm.provider :aws do |aws| config.vm.box = "dummy" config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"