1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

vagrant; issue #113: Make Vagrantfile backward compatible with versions < 1.1

This commit is contained in:
Daniel Mizyrycki 2013-03-21 17:23:23 -07:00
parent 13e597a5ad
commit 6295a02275

17
Vagrantfile vendored
View file

@ -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"