2013-02-04 01:02:41 -05:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
2013-04-23 12:44:09 -04:00
|
|
|
BOX_NAME = "ubuntu"
|
|
|
|
BOX_URI = "http://files.vagrantup.com/precise64.box"
|
|
|
|
PPA_KEY = "E61D797F63561DC6"
|
|
|
|
|
|
|
|
Vagrant::Config.run do |config|
|
|
|
|
# Setup virtual machine box. This VM configuration code is always executed.
|
|
|
|
config.vm.box = BOX_NAME
|
|
|
|
config.vm.box_url = BOX_URI
|
|
|
|
# Add docker PPA key to the local repository and install docker
|
2013-04-29 14:53:50 -04:00
|
|
|
pkg_cmd = "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys #{PPA_KEY}; "
|
2013-04-23 12:44:09 -04:00
|
|
|
pkg_cmd << "echo 'deb http://ppa.launchpad.net/dotcloud/lxc-docker/ubuntu precise main' >>/etc/apt/sources.list; "
|
|
|
|
pkg_cmd << "apt-get update -qq; apt-get install -q -y lxc-docker"
|
|
|
|
if ARGV.include?("--provider=aws".downcase)
|
|
|
|
# Add AUFS dependency to amazon's VM
|
|
|
|
pkg_cmd << "; apt-get install linux-image-extra-3.2.0-40-virtual"
|
2013-03-22 01:26:18 -04:00
|
|
|
end
|
2013-04-23 12:44:09 -04:00
|
|
|
config.vm.provision :shell, :inline => pkg_cmd
|
2013-03-15 00:22:07 -04:00
|
|
|
end
|
2013-04-19 23:57:50 -04:00
|
|
|
|
2013-04-23 12:44:09 -04:00
|
|
|
# Providers were added on Vagrant >= 1.1.0
|
|
|
|
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
|
2013-04-19 23:57:50 -04:00
|
|
|
config.vm.provider :aws do |aws, override|
|
|
|
|
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"]
|
|
|
|
override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
|
|
|
|
override.ssh.username = "ubuntu"
|
|
|
|
aws.region = "us-east-1"
|
|
|
|
aws.ami = "ami-d0f89fb9"
|
|
|
|
aws.instance_type = "t1.micro"
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provider :rackspace do |rs|
|
|
|
|
config.vm.box = "dummy"
|
|
|
|
config.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
|
|
|
|
config.ssh.private_key_path = ENV["RS_PRIVATE_KEY"]
|
|
|
|
rs.username = ENV["RS_USERNAME"]
|
|
|
|
rs.api_key = ENV["RS_API_KEY"]
|
|
|
|
rs.public_key_path = ENV["RS_PUBLIC_KEY"]
|
|
|
|
rs.flavor = /512MB/
|
|
|
|
rs.image = /Ubuntu/
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provider :virtualbox do |vb|
|
2013-04-23 12:44:09 -04:00
|
|
|
config.vm.box = BOX_NAME
|
|
|
|
config.vm.box_url = BOX_URI
|
2013-04-19 23:57:50 -04:00
|
|
|
end
|
2013-04-25 07:59:31 -04:00
|
|
|
|
|
|
|
config.vm.provider :vmware_fusion do |vm|
|
|
|
|
config.vm.box = "precise64"
|
|
|
|
config.vm.box_url = "http://files.vagrantup.com/precise64_vmware_fusion.box"
|
2013-04-25 08:09:04 -04:00
|
|
|
config.vm.provision :shell, :inline => <<-UPDATE
|
2013-04-25 08:29:13 -04:00
|
|
|
apt-get install -y linux-image-extra-3.2.0-29-virtual
|
2013-04-25 08:09:04 -04:00
|
|
|
UPDATE
|
2013-04-25 07:59:31 -04:00
|
|
|
end
|
2013-04-19 23:57:50 -04:00
|
|
|
end
|