Hacker News new | past | comments | ask | show | jobs | submit login

So it was good that I didn't spend time learning chef/puppet or going with RightScale till now?



I'm not so sure (given I spent quite some time learning Chef). With Chef I can deploy to a Vagrant VM running on my laptop, to a local server, to our VMs hosted by another company, or to EC2. This is great for testing, and it gives some useful diversity. For example, the disk IO throughput on EC2 isn't great so we're considering deploying our data stores to some dedicated servers. We can use the same deployment process to manage these and our EC2 servers. This seems like a win.


Nope, CloudFormation is for infrastructure provisioning. Configuration management is still valuable post-boot.

I've been using CloudFormation in conjunction with Chef - they're complementary tools, really.


Can you share some example of how you are using them together. I am currently using Python scripts with boto to bring up the instances and doing all kinds of configuration stuff on them. Just wanted to see if there is any better way of doing this.


Basically, you just need to pass a Chef bootstrap script in through the instance's user-data.

Knife, a Chef management and interaction tool, provides several bootstrap scripts you could use as a starting point: https://github.com/opscode/chef/tree/master/chef/lib/chef/kn...

Let's use the Ubuntu 10.04 gem bootstrap script as an example (https://github.com/opscode/chef/blob/master/chef/lib/chef/kn...). The basic steps to use this with Chef would be:

(Note that this assumes you have a Chef server or are using the Opscode Platform. There's also a server-less option called "chef-solo" that you can use)

1. Create an appropriate first-boot.json to be used by the node(s). This will probably just be a "run_list" with entries like "role[app_server]" (function) and "role[production]" (environment).

2. Replace line 42 of the bootstrap script with your first-boot.json. Since this bootstrap script is actually a template, make sure to replace all other .erb stuff ("<%= %>") as appropriate.

3. JSON-encode the bootstrap script (handy tool: http://artur.ejsmont.org/blog/content/ultimate-web-encoder-d...)

4. Build your CF template, placing the JSON-encoded script in the "user data" section of your instance/auto-scaling group(s).

5. Instantiate your CF stack

If you'd like to use Chef for the entire lifecycle of your instances, just include a Chef recipe for running chef-client via cron every, say, 5 minutes. This allows changes to be propagated automatically in a pull style.

Done right, the end result is a complete, Chef-managed environment provisioned from bare metal using just one command.


Cool, thanks a lot for sharing. Your post has given me the motivation to start learning Chef. Maybe you can blog about it somewhere to help wanna be cloud programmers like me.


You can also bootstrap using Puppet. Basically you generate a template that you can use to upload to CF and it will just run the bootstrap script from the UserData section when the instance is started. See the wiki here: http://projects.puppetlabs.com/projects/puppet/wiki/Bootstra...


I'm sure the service will grow with more features. One thing is for sure, Rightscale can be a bit costly. I welcome anything in the AWS management space that saves money.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: