Configuration for setting up development and cloud servers for a new internal or client project at Cloudspace. The repo also contains initial Capistrano deploy setups and a dev environment Vagrantfile you can use as a starting point.
For most projects you can use a default build and then customize as needed. Here are links to download default Vagrant (.box files), Virtualbox (.ovf & .vmdk), and aws (ami listed in .txt file)
- Ubuntu: http://devops.cloudspace.com/images/?prefix=images/ubuntu/
- Ubuntu + MySQL: http://devops.cloudspace.com/images/?prefix=images/mysql/
- Ubuntu + NodeJS: http://devops.cloudspace.com/images/?prefix=images/node/
- Ubuntu + PostgreSQL: http://devops.cloudspace.com/images/?prefix=images/postgresql/
- Ubuntu + Ruby: http://devops.cloudspace.com/images/?prefix=images/ruby/
- Ubuntu + Ruby + MySQL: http://devops.cloudspace.com/images/?prefix=images/ruby-mysql/
- Ubuntu + Ruby + PostgreSQL: http://devops.cloudspace.com/images/?prefix=images/ruby-postgresql/
-
Copy this repo into your own project.
-
Set your AWS key/secret as an environment variable
export AWS_ACCESS_KEY_ID="xxxxxxxxx" export AWS_SECRET_ACCESS_KEY="xxxxxxx
-
Edit
devops/packer.json
to add any needed config files fromdevops/packer-shell-scripts
(Note: The packer-shell-scripts are a git submodule and will needed to be imported withgit submodule update
.) -
Run the build script in the
devops
directorypacker build packer.json
-
Use the sample Vagrantfile to launch the vagrant .box file that was created, open the ovf in Virtualbox, or launch your custom AMI on Amazon using the instructions below.
- Login to the EC2 console with your Amazon IAM account using the IAM login for your client. (For cloudspace use https://cloudspace.signin.aws.amazon.com/console) If you don't have an Amazon IAM user setup, request one from DevOps.
- Click "EC2"
- Click "Launch Instance"
- Find the AMI for your project in my amis or community amis. Usually you will use one of the default builds from https://github.com/cloudspace-devops/packer-image-scripts to start; then create a custom build using packer as needed. If you are sure you can use ami-c8cf3ba0.
- Scroll down, select instance size (m1.small is a good start, then move to c3.large as needed) and click "Next: Configure Instance Details"
- Normally you can just leave the defaults and click "Next: Add Storage." If you need to set any keys or system jobs, especially with CoreOS, use cloud-init in the User Data field under Advanced Details. See http://cloudinit.readthedocs.org/en/latest/topics/examples.html for more information.
- Select your storage site (usually 8GB to start) & volume type (General Purpose SSD is the same price as Magnetic so you should usually select GPSSD), and click "Next: Tag Instance."
- Name your instance and click "Next: Configure Security Group"
- Create or select your security group. For most Cloudspace projects, select the existing "default" group. Click "Review and Launch."
- Scroll down and click "Launch."
- Choose an existing keypair or make a new one. For most Cloudspace projects, select the "ops" key pair and check the box acknowledging you have access to the key.
- Click "Launch Instances."
- Scroll down and click "View Instances."
- Grab the public ip of your launched container and toss that in the .env file under the environment you are setting up.