From 16a6ba544fd281871d0fa6ac2d2b56efc5b2b434 Mon Sep 17 00:00:00 2001 From: Daniel Mizyrycki Date: Thu, 21 Mar 2013 17:23:23 -0700 Subject: [PATCH 1/2] vagrant; issue #113: Make Vagrantfile backward compatible with versions < 1.1 Upstream-commit: 6295a022750627d433c5c44872393ede4f1d8051 Component: engine --- components/engine/Vagrantfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/components/engine/Vagrantfile b/components/engine/Vagrantfile index e847659848..25b27302e1 100644 --- a/components/engine/Vagrantfile +++ b/components/engine/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" From 9420f9fed2e37f8a3565faec691ab3500bf100e3 Mon Sep 17 00:00:00 2001 From: Daniel Mizyrycki Date: Thu, 21 Mar 2013 22:26:18 -0700 Subject: [PATCH 2/2] vagrant; issue #113: normalize whitespaces Upstream-commit: 45df6f7801554ccb24ba8ccf42ec5a847262b9ca Component: engine --- components/engine/Vagrantfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/engine/Vagrantfile b/components/engine/Vagrantfile index 25b27302e1..4cf5f0a0e5 100644 --- a/components/engine/Vagrantfile +++ b/components/engine/Vagrantfile @@ -112,19 +112,19 @@ 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" + config.vm.box = "dummy" + config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"] - aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] - aws.keypair_name = ENV["AWS_KEYPAIR_NAME"] - aws.ssh_private_key_path = ENV["AWS_SSH_PRIVKEY"] - aws.region = "us-east-1" + aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] + aws.keypair_name = ENV["AWS_KEYPAIR_NAME"] + aws.ssh_private_key_path = ENV["AWS_SSH_PRIVKEY"] + aws.region = "us-east-1" aws.ami = "ami-1c1e8075" aws.ssh_username = "vagrant" - aws.instance_type = "t1.micro" + aws.instance_type = "t1.micro" end config.vm.provider :virtualbox do |vb| - config.vm.box = "quantal64_3.5.0-25" - config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box" - end + config.vm.box = "quantal64_3.5.0-25" + config.vm.box_url = "http://get.docker.io/vbox/ubuntu/12.10/quantal64_3.5.0-25.box" + end end