Created
July 29, 2013 01:14
-
-
Save skinp/6101582 to your computer and use it in GitHub Desktop.
Vagrantfile supporting multiple providers (VirtualBox, AWS, LXC)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
BOX_NAME = ENV['BOX_NAME'] || "ubuntu" | |
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise32.box" | |
AWS_REGION = ENV['AWS_REGION'] || "us-east-1" | |
AWS_AMI = ENV['AWS_AMI'] || "ami-23d9a94a" | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = BOX_NAME | |
config.vm.box_url = BOX_URI | |
# config.vm.synced_folder "../data", "/vagrant_data" | |
config.vm.provider :virtualbox do |vb| | |
config.vm.box = BOX_NAME | |
config.vm.box_url = BOX_URI | |
#vb.customize ["modifyvm", :id, "--memory", "1024"] | |
end | |
config.vm.provider :aws do |aws, override| | |
aws.access_key_id = ENV["AWS_ACCESS_KEY"] | |
aws.secret_access_key = ENV["AWS_SECRET_KEY"] | |
aws.keypair_name = "ec2" | |
override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"] | |
override.ssh.username = "ubuntu" | |
override.vm.box = "dummy" | |
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" | |
aws.ami = AWS_AMI | |
aws.region = AWS_REGION | |
aws.instance_type = "t1.micro" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment