Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm wearing the devops hat for my company. All our infrastructure is manually configured in AWS and I would like to start using Chef for configuration.

First step: Make it easy to bootstrap an environment and reach out to the chef server! Here is my thoughts on how to approach it.

  1. Start a fresh Ubuntu AMI
  2. Add a script that runs at startup the bootstraps an enviro (ruby, ruby gems, etc.) and registers with Chef.
  3. Squirrel away this as a custom AMI so I can start many of these.

So, my question is: What is the best way to go about running a script just once on the next startup?

share|improve this question
add comment

2 Answers

Do read the OpsCode wiki. In my opinion, it has too much information for someone to easily lose track.

Your approach should be like this:

Use Knife to launch the fresh Ubuntu/CentOS AMI with the required run list. Your run list is basically roles which contain the cookbooks. Cookbooks contain recipes of what you actually want to automate.

Ideally, you should never create a custom AMI from this chef managed image. Thats the whole point of using these configuration management tools.

share|improve this answer
add comment

Have you looked at the Opscode wiki entry on using Chef with EC2?

http://wiki.opscode.com/display/chef/EC2+Bootstrap+Fast+Start+Guide

Basically, you would start up an EC2 instance you can ssh into, then run a knife bootstrap command against it. The knife command will do all that stuff you have in Step 2. You can tweak the knife bootstrap template to specify the Chef recipes/roles you want to apply to the node. You should not need to do Step 3.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.