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

Adding support for the Rackspace Open Cloud

This commit is contained in:
Antony Messerli 2013-03-22 10:28:51 -05:00
parent 41c664cacf
commit 95ad9e4573
3 changed files with 54 additions and 15 deletions

View file

@ -94,10 +94,11 @@ Docker probably works on other distributions featuring a recent kernel, the AUFS
Installing with Vagrant
-----------------------
Currently, Docker can be installed with Vagrant both on your localhost
with VirtualBox as well as on Amazon EC2. Vagrant 1.1 is required for
EC2, but deploying is as simple as:
Currently, Docker can be installed with Vagrant on your localhost with VirtualBox,
Amazon EC2, and Rackspace Cloud Servers. Vagrant 1.1 is required for EC2 and
Rackspace Cloud, but deploying is as simple as:
Amazon EC2:
```bash
$ export AWS_ACCESS_KEY_ID=xxx \
AWS_SECRET_ACCESS_KEY=xxx \
@ -114,6 +115,23 @@ The environment variables are:
* `AWS_KEYPAIR_NAME` - The name of the keypair used for this EC2 instance
* `AWS_SSH_PRIVKEY` - The path to the private key for the named keypair
Rackspace Cloud Servers:
```bash
$ export RS_USERNAME=xxx \
RS_API_KEY=xxx \
RS_PUBLIC_KEY=xxx \
RS_PRIVATE_KEY=xxx
$ vagrant plugin install vagrant-rackspace
$ vagrant up --provider=rackspace
```
The environment variables are:
* `RS_USERNAME` - The user name used to make requests to Rackspace Cloud
* `RS_API_KEY` - The secret key to make Rackspace Cloud API requests
* `RS_PUBLIC_KEY` - The location on disk to your public key that will be injected into the instance.
* `RS_PRIVATE_KEY` - The private key that matches the public key being injected.
For VirtualBox, you can simply ignore setting any of the environment
variables and omit the `provider` flag. VirtualBox is still supported with
Vagrant <= 1.1:

21
Vagrantfile vendored
View file

@ -31,6 +31,9 @@ Vagrant.configure("1") do |config|
# computers to access the VM, whereas host only networking does not.
# config.vm.forward_port 80, 8080
# Ensure puppet is installed on the instance
config.vm.provision :shell, :inline => "apt-get -qq update; apt-get install -y puppet"
# 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.
@ -103,17 +106,27 @@ 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"
aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
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.ami = "ami-1c1e8075"
aws.ssh_username = "vagrant"
aws.ami = "ami-1c1e8075"
aws.ssh_username = "vagrant"
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|
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
end

View file

@ -25,6 +25,9 @@ class virtualbox {
class ec2 {
}
class rax {
}
class docker {
# update this with latest docker binary distro
@ -42,13 +45,17 @@ class docker {
notify { "docker_url = $docker_url": withpath => true }
$ec2_version = file("/etc/ec2_version", "/dev/null")
if ($ec2_version) {
include ec2
} else {
# virtualbox is the vagrant default, so it should be safe to assume
include virtualbox
}
$ec2_version = file("/etc/ec2_version", "/dev/null")
$rax_version = inline_template("<%= %x{/usr/bin/xenstore-read vm-data/provider_data/provider} %>")
if ($ec2_version) {
include ec2
} elsif ($rax_version) {
include rax
} else {
# virtualbox is the vagrant default, so it should be safe to assume
include virtualbox
}
user { "vagrant":
ensure => present,
@ -84,6 +91,7 @@ class docker {
}
file { "/home/vagrant":
ensure => directory,
mode => 644,
require => User["vagrant"],
}
@ -91,7 +99,7 @@ class docker {
file { "/home/vagrant/.profile":
mode => 644,
owner => "vagrant",
group => "ubuntu",
group => "vagrant",
content => template("docker/profile"),
require => File["/home/vagrant"],
}