Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Custom bootstrap for quickstart, installs older working rubygems for …

…rake
  • Loading branch information...
commit ddfb863f76b0fc5e47ce98690c8d13f4057e490f 1 parent 06a6bee
Joshua Timberman jtimberman authored

Showing 2 changed files with 49 additions and 10 deletions. Show diff stats Hide diff stats

  1. +39 0 .chef/bootstrap/ubuntu10.04-gems-qs.erb
  2. +10 10 README.md
39 .chef/bootstrap/ubuntu10.04-gems-qs.erb
... ... @@ -0,0 +1,39 @@
  1 +bash -c '
  2 +<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
  3 +
  4 +if [ ! -f /usr/bin/chef-client ]; then
  5 + apt-get update
  6 + apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
  7 + cd /tmp
  8 + wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
  9 + tar zxf rubygems-1.3.7.tgz
  10 + cd rubygems-1.3.7
  11 + ruby setup.rb --no-format-executable
  12 +fi
  13 +
  14 +gem install ohai --no-rdoc --no-ri --verbose
  15 +gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
  16 +
  17 +mkdir -p /etc/chef
  18 +
  19 +(
  20 +cat <<'EOP'
  21 +<%= validation_key %>
  22 +EOP
  23 +) > /tmp/validation.pem
  24 +awk NF /tmp/validation.pem > /etc/chef/validation.pem
  25 +rm /tmp/validation.pem
  26 +
  27 +(
  28 +cat <<'EOP'
  29 +<%= config_content %>
  30 +EOP
  31 +) > /etc/chef/client.rb
  32 +
  33 +(
  34 +cat <<'EOP'
  35 +<%= { "run_list" => @run_list }.to_json %>
  36 +EOP
  37 +) > /etc/chef/first-boot.json
  38 +
  39 +<%= start_chef %>'
20 README.md
Source Rendered
... ... @@ -1,4 +1,4 @@
1   -This guide describes how to build a Ruby On Rails application stack using Chef cookbooks available from the [Cookbooks Community Site](http://cookbooks.opscode.com) and the Opscode Platform. It assumes you followed the [Getting Started Guide](http://help.opscode.com/faqs/start/how-to-get-started) and have Chef installed.
  1 +This guide describes how to build a Ruby On Rails application stack using Chef cookbooks available from the [Cookbooks Community Site](http://cookbooks.opscode.com) and Hosted Chef. It assumes you followed the [Getting Started Guide](http://help.opscode.com/faqs/start/how-to-get-started) and have Chef installed.
2 2
3 3 *This guide uses Ubuntu 10.04 on Amazon AWS EC2 with Chef 0.10.0.*
4 4
@@ -104,7 +104,7 @@ The rails-quick-start has all the cookbooks we need for this guide. They were do
104 104 radiant
105 105 haproxy
106 106
107   -Upload all the cookbooks to the Opscode Platform.
  107 +Upload all the cookbooks to Hosted Chef.
108 108
109 109 knife cookbook upload -a
110 110
@@ -119,7 +119,7 @@ All the required roles have been created in the rails-quick-start repository. Th
119 119 radiant_run_migrations.rb
120 120 radiant_load_balancer.rb
121 121
122   -Upload all the roles to the Opscode Platform.
  122 +Upload all the roles to Hosted Chef.
123 123
124 124 rake roles
125 125
@@ -128,7 +128,7 @@ Data Bag Item
128 128
129 129 The rails-quick-start repository contains a data bag item that has all the information required to deploy and configure the Radiant application from source using the recipes in the **application** and **database** cookbooks.
130 130
131   -The data bag name is **apps** and the item name is **radiant**. Upload this to the Opscode Platform.
  131 +The data bag name is **apps** and the item name is **radiant**. Upload this to Hosted Chef.
132 132
133 133 knife data bag create apps
134 134 knife data bag from file apps radiant.json
@@ -143,7 +143,7 @@ In either case, we're going to use m1.small instances with the 32 bit Ubuntu 10.
143 143 This command will:
144 144
145 145 * Launch a server on EC2.
146   -* Connect it to the Opscode Platform.
  146 +* Connect it to Hosted Chef.
147 147 * Configure the system with Chef.
148 148
149 149 See the appropriate section below for instruction on launching a single instance, or launching the multi-system infrastructure.
@@ -154,7 +154,7 @@ Launch Single Instance
154 154 Launch the entire stack on a single instance.
155 155
156 156 knife ec2 server create -G default -I ami-7000f019 -f m1.small \
157   - -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu \
  157 + -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu -d ubuntu10.04-gems-qs \
158 158 -r 'role[base],role[radiant_database_master],role[radiant],role[radiant_run_migrations],recipe[radiant::db_bootstrap],role[radiant_load_balancer]'
159 159
160 160 Once complete, the instance will be running MySQL and Radiant under Unicorn. With only one system, a load balancer is unnecessary.
@@ -167,25 +167,25 @@ We will launch one database server, two application servers and one load balance
167 167 First, launch the database instance.
168 168
169 169 knife ec2 server create -G default -I ami-7000f019 -f m1.small \
170   - -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu \
  170 + -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu -d ubuntu10.04-gems-qs \
171 171 -r 'role[base],role[radiant_database_master]'
172 172
173 173 Once the database master is up, launch one node that will run database migration and set up the database with default data.
174 174
175 175 knife ec2 server create -G default -I ami-7000f019 -f m1.small \
176   - -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu \
  176 + -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu -d ubuntu10.04-gems-qs \
177 177 -r 'role[base],role[radiant],role[radiant_run_migrations],recipe[radiant::db_bootstrap]'
178 178
179 179 Launch the second application instance w/o the **radiant_run_migrations** role or **radiant::db_bootstrap** recipe.
180 180
181 181 knife ec2 server create -G default -I ami-7000f019 -f m1.small \
182   - -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu \
  182 + -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu -d ubuntu10.04-gems-qs \
183 183 -r 'role[base],role[radiant]'
184 184
185 185 Once the second application instance is up, launch the load balancer.
186 186
187 187 knife ec2 server create -G default -I ami-7000f019 -f m1.small \
188   - -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu \
  188 + -S rails-quick-start -i ~/.ssh/rails-quick-start.pem -x ubuntu -d ubuntu10.04-gems-qs \
189 189 -r 'role[base],role[radiant_load_balancer]'
190 190
191 191 Once complete, we'll have four instances running in EC2 with MySQL, Radiant and haproxy up and available to serve traffic.

0 comments on commit ddfb863

Please sign in to comment.
Something went wrong with that request. Please try again.