Permalink
Browse files

updates readme. updates configuration names

  • Loading branch information...
1 parent 17cef42 commit 3a2a35ee69a8ab95b80cb062031f89f56bca62de @slagyr slagyr committed Sep 26, 2012
Showing with 97 additions and 27 deletions.
  1. +83 −19 README.md
  2. +7 −0 Rakefile
  3. +1 −2 boucher.gemspec
  4. +3 −3 lib/boucher/meals.rb
  5. +3 −3 spec/boucher/meals_spec.rb
View
102 README.md
@@ -1,60 +1,86 @@
<img src="" alt="boucher logo" title="Boucher" align="right"/>
# Boucher
-...
+Boucher, pronounced [boo-shay], and meaning Butcher in French, is a suite of Rake tasks that simplfy your AWS
+deployment strategy. It's built ontop of Chef and Fog giving your fingers the power to create new servers,
+install required software, and deploy your system all in a single command.
+
+It also helps manage your system with support for different environments and tasks to:
+
+ * list all your servers
+ * start/stop/terminate servers
+ * run chef on a given server
+ * easily ssh into a server
+ * attach volumes or elastic IPs to your servers
## Getting Started
+Getting up and running with Boucher might take a little while depending your your familiarity with AWS and Linux.
+Once you're up and running though, it'll save you countless hours in the long run.
+
+### Creating your infrastructure project.
+
+Boucher assumes a certain directory structure. Bummer I know, but c'est la vie. To help you out, we've provided a git repo
+that'll get you off the ground. We recomend
+
+ git clone git://github.com/8thlight/boucher_template.git infrastructure
+ rm -rf infrastructure/.git
+
+You'll probabaly want to create a repository for your own to track the work here.
+
+Read config/env/shared.rb to get a feel for the configuration options. You'll fill in some of those values as your continue to get started below.
### Creating a base image
-1. Launch new instance: Ubuntu Server 12.04.1 LTS
- * Create a new key saved in your infrastructure project
- * Be sure to add a security group that opens port 22 for SSH
+1) Launch new instance: Ubuntu Server 12.04.1 LTS
+
+ * Create a new key saved in your infrastructure project
+ * Be sure to add a security group that opens port 22 for SSH
+
+2) Update config/env/shared.rb
-2. Update config/env/shared.rb
- * :aws_key_filename - name of the .pem file you just created and saved in the project root
- * :aws_region - which AWS region did you use?
- * :aws_access_key_id and aws_secret_access_key - available in the AWS Management Console under Security Credentials
+ * :aws_key_filename - name of the .pem file you just created and saved in the project root
+ * :aws_region - which AWS region did you use?
+ * :aws_access_key_id and aws_secret_access_key - available in the AWS Management Console under Security Credentials
-3. List servers
+3) List servers
rake servers:list
-4. SSH into new server. (:username config must be 'ubunutu' at this point)
+4) SSH into new server. (:username config must be 'ubunutu' at this point)
rake servers:ssh[<instance id>]
-5. Create new poweruser (unless you like 'unubutu' as your poweruser).
+5) Create new poweruser (unless you like 'unubutu' as your poweruser).
sudo adduser <username>
sudo adduser <username> sudo
sudo mkdir /home/<username>/.ssh
sudo cp .ssh/authorized_keys /home/<username>/.ssh/
sudo chown -R <username>:<username> /home/<username>/.ssh
-6. Logout. Update config :username. Log back in.
+6) Logout. Update config :username. Log back in.
rake servers:ssh[<instance id>]
-7. Delete the ubuntu user.
+7) Delete the ubuntu user.
deluser ubuntu
-8. Enable sudo without typing password
+8) Enable sudo without typing password
sudo visudo
# add the following line at the end of the file:
<username> ALL=(ALL) NOPASSWD: ALL
-9. Install required pacakges and gems.
+9) Install required pacakges and gems.
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev git gcc make libxml2-dev libxslt1-dev
sudo apt-get upgrade
sudo gem install bundler chef
-10. Checkout your infrstructure repo. (Yes. You should push your repo even in this early stage.)
+10) Checkout your infrstructure repo. (Yes. You should push your repo even in this early stage.)
If you use github, you'll have to generate ssh keys and add them to the github repo.
cd ~/.ssh
@@ -63,17 +89,55 @@ If you use github, you'll have to generate ssh keys and add them to the github r
cd ..
git clone git@github.com:<github account name>/<your infratructure project name>.git infrastructure
-11. Customize to your liking.
+11) Customize to your liking.
- * install your preferred vim dot files
- * etc...
+ * install your preferred vim dot files
+ * etc...
+
+12) Create an AMI using the AWS Management console. Grab the AMI id and put it in config/env/shared.rb as the :default_image_id config value.
## Usage
Run rake to see the list of tasks provided.
rake -T
+### Meals
+
+We're sticking with the metephore here. A Meal is basically a set of recipes for a single server.
+Boucher will expect meals to exist in the config directory. They are JSON files usable by chef-solo, and Boucher
+allows you too add extra configuration information under the "Boucher": key. For example:
+
+ {
+ "run_list": [
+ "recipe[boucher::base]"
+ ]
+
+ "Boucher": {
+ "base_image_id": "ami-abcd1234" // overides :default_image_id config
+ "flavor_id": t1.micro // overides :default_flavor_id config
+ "groups": ["SSH"] // overides :default_groups config
+ "key_name": ["SSH"] // overides :aws_key_filename config
+ "elastic_ips": [1.2.3.4] // a list of elastic IPs that'll be attached to the server. Elastic IP's acquired via AWS management console.
+ "volumes": ["volume1"] // a list of volume names that'll be attached to the server. Volumes acquired via AWS management console.
+ }
+ }
+
+### Environments
+
+Enviroments are configured in config/env/<env_name>.rb. The project template we checked out earlier only provides one: dev.
+You're welcome to create as many environments as you like. At the top of each environment config file, require the shared
+config and then you can overide or add any configuration below.
+
+
+Environment configuration is available in your chef recipes. Just require 'boucher/env' in any recipe and extract values like so:
+
+ Boucher::Config[:my_config_value]
+
+### Recipes
+
+We'll assume you're familiar with Chef. Borrow, Steal, or Build recipes as you like. They go in the cookbooks directory.
+
## License
Copyright (c) 2012 8th Light, Inc.
View
@@ -8,3 +8,10 @@ end
desc "Default: run the specs."
task :default => :spec
+
+desc "Push gem to rubygems.org"
+task :push do
+ system "rm boucher-*.gem"
+ system "gem build boucher.gemspec"
+ system "gem push boucher-*.gem"
+end
View
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = "boucher"
- s.version = "0.1"
+ s.version = "0.1.1"
s.authors = ["'Micah Micah'"]
s.email = ["'micah@8thlight.com'"]
s.homepage = "http://github.com/8thlight/boucher"
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = []
s.require_paths = ["lib"]
- s.autorequire = 'boucher/tasks'
s.add_dependency('rake', '>= 0.9.2.2')
s.add_dependency('fog', '>= 1.6.0')
View
@@ -29,9 +29,9 @@ def self.meal(meal_name)
end
def self.setup_meal(server, meal)
- server.image_id = meal[:base_image_id] || Boucher::Config[:base_image_id]
- server.flavor_id = meal[:flavor_id] || Boucher::Config[:default_instance_flavor_id]
- server.groups = meal[:groups] || Boucher::Config[:default_instance_groups]
+ server.image_id = meal[:image_id] || Boucher::Config[:default_image_id]
+ server.flavor_id = meal[:flavor_id] || Boucher::Config[:default_flavor_id]
+ server.groups = meal[:groups] || Boucher::Config[:default_groups]
server.key_name = meal[:key_name] || Boucher::Config[:aws_key_filename]
server.tags = {}
server.tags["Name"] = "#{meal[:meal_name] || "base"} #{Time.new.strftime("%Y%m%d%H%M%S")}"
@@ -20,11 +20,11 @@
it "can classify base server" do
some_class = {:meal_name => "base",
:meals => ["base"]}
- Boucher::Config[:default_instance_flavor_id] = 'm1.small'
- Boucher::Config[:default_instance_groups] = ["SSH"]
+ Boucher::Config[:default_flavor_id] = 'm1.small'
+ Boucher::Config[:default_groups] = ["SSH"]
Boucher.setup_meal(@server, some_class)
- @server.image_id.should == Boucher::Config[:base_image_id]
+ @server.image_id.should == Boucher::Config[:default_image_id]
@server.flavor_id.should == 'm1.small'
@server.groups.should == ["SSH"]
@server.key_name.should == "test_key"

0 comments on commit 3a2a35e

Please sign in to comment.