Skip to content

Instantly share code, notes, and snippets.

@peregrinator
Created July 13, 2010 23:19
Show Gist options
  • Save peregrinator/474728 to your computer and use it in GitHub Desktop.
Save peregrinator/474728 to your computer and use it in GitHub Desktop.
cloud :staging_server do
# basic settings
using :ec2
keypair "path_to_server_key.pem"
user "ubuntu"
image_id "ami-bb709dd2" #Ubuntu 9.10 Karmic Canonical, ubuntu@
availability_zones ['us-east-1d']
instances 1
instance_type 'm1.small'
#attach the ebs volumes
ebs_volumes do
size 80
device "/dev/sdh"
snapshot_id "snap-1234abcd" #TODO find a way to automate this as it's new everyday...!
end
chef :solo do
repo File.join(File.dirname(__FILE__) , "chef_cloud")
recipe "apt"
recipe "apache2"
recipe "passenger_enterprise::apache2"
recipe 'rubygems'
recipe "mysql::server"
recipe "mysql::server_ec2"
recipe "git"
recipe "capistrano"
recipe "rails"
attributes {
:aws => {
:ebs => {
:volume_id => "vol-abcd1234",
:elastic_ip => "123.456.7.89"
}
},
:varnish => {
:storage_size => '250M'
},
:passenger_enterprise => {
:pool_idle_time => 24*60*60
}
}
end
security_group "web" do
authorize :from_port => "22", :to_port => "22"
authorize :from_port => "80", :to_port => "80"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment