A talk by Leonid Shevtsov at RubyGarage, September 6, 2012
Video (in Russian): http://www.youtube.com/watch?v=hzuSW4DjkKQ
RubyGarage, Dnipropetrovsk, Ukraine http://rubygarage.org/
Leonid Shevtsov http://leonid.shevtsov.me
Moving towards automated server configuration with a small team
1. Add some Chef to your
Capistrano
Moving towards automated server configuration with a small team
@leonid_shevtsov for @RubyGarage, Sep 2012
2. About me
• I’m Leonid Shevtsov, http://l-s.me
• I code Ruby and Javascript at Railsware http://railsware.com
• I’ve configured and deployed tens of applications.
• (though no 100-server ones).
3. Why bother with CM tools?
• You have to manage hundreds of servers
4. Why bother with CM tools?
• You have to manage hundreds of servers
5. Why bother with CM tools?
• Make implicit knowledge explicit.
• Turn configuration into code.
• Test on a virtual machine, not the live server.
6. Make implicit knowledge explicit
• All configuration in one place;
• Indicate what options are customized/important;
• What if the sysadmin (or the “server guy”) gets sick (or fired)?
• Discourages (though doesn’t prohibit) shotgun debugging;
7. Turn configuration into code
• People grok code.
• Code can be diffed
• Code can be merged
• You can collaborate on code
• You can share code between projects
• You can refactor code
8. Stop developing on live servers
• No more Vim via SSH to production;
• Really identical staging environment;
• Test entire stack on a virtual machine;
11. Push vs Pull
• “Pull” configuration - suitable for major web sites
• Servers update configuration automatically based on central node
• Requires infrastructure
• “Push” configuration - suitable for “less than major” sites
• You update configuration manually on demand
• Natural next step from Capistrano
12. Cuoco
• Capistrano can connect to and run commands on your server;
• Chef Solo can configure your server if it’s already there;
• Let’s use them together!
https://github.com/leonid-shevtsov/cuoco
13. How to add Chef to Capistrano
• Capistrano should already have servers and roles
• Add Cuoco to your project
• Add a config/chef directory
• Start cooking!
• To run Chef, run cap cuoco:run_chef
14. • To bootstrap & run Chef, run cap cuoco:update_configuration
• Works with capistrano multistage!
• Works with host & role filters!
• Servers pick up roles from Capistrano configuration
15. Questions? Comments?
leonid@shevtsov.me
Thanks to RailsWare http://railsware.com