SlideShare a Scribd company logo
1 of 15
Add some Chef to your
         Capistrano
Moving towards automated server configuration with a small team




        @leonid_shevtsov for @RubyGarage, Sep 2012
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).
Why bother with CM tools?



•   You have to manage hundreds of servers
Why bother with CM tools?



•   You have to manage hundreds of servers
Why bother with CM tools?


•   Make implicit knowledge explicit.

•   Turn configuration into code.

•   Test on a virtual machine, not the live server.
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;
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
Stop developing on live servers


•   No more Vim via SSH to production;

•   Really identical staging environment;

•   Test entire stack on a virtual machine;
Automated server configuration is
          the future
                              (IMO)
Practice
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
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
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
•   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
Questions? Comments?

           leonid@shevtsov.me
 Thanks to RailsWare http://railsware.com

More Related Content

Viewers also liked

Debbug Rails Application For Dummies
Debbug Rails Application For DummiesDebbug Rails Application For Dummies
Debbug Rails Application For Dummies
Andrey Subbota
 
развертывание среды Rails (антон веснин, Locum Ru)
развертывание среды Rails (антон веснин, Locum Ru)развертывание среды Rails (антон веснин, Locum Ru)
развертывание среды Rails (антон веснин, Locum Ru)
guest40e031
 
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
Alexander Dymo
 
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
Andrey Listochkin
 
Refactorings with RubyMine
Refactorings with RubyMineRefactorings with RubyMine
Refactorings with RubyMine
avokin
 
Системное тестирование приложений на Ruby on Rails с применением Rspec и Cap...
Системное тестирование  приложений на Ruby on Rails с применением Rspec и Cap...Системное тестирование  приложений на Ruby on Rails с применением Rspec и Cap...
Системное тестирование приложений на Ruby on Rails с применением Rspec и Cap...
lshevtsov
 
Errbit - агрегатор сбоев в продакшене
Errbit - агрегатор сбоев в продакшенеErrbit - агрегатор сбоев в продакшене
Errbit - агрегатор сбоев в продакшене
Andrey Subbota
 
Отладка и эксплуатация Rails-приложений
Отладка и эксплуатация Rails-приложенийОтладка и эксплуатация Rails-приложений
Отладка и эксплуатация Rails-приложений
Egor Baranov
 
Разрушаем негативные мифы Ruby, Rails.
Разрушаем негативные мифы Ruby, Rails.Разрушаем негативные мифы Ruby, Rails.
Разрушаем негативные мифы Ruby, Rails.
Ravil Bayramgalin
 

Viewers also liked (20)

Ruby on Rails for noobs
Ruby on Rails for noobsRuby on Rails for noobs
Ruby on Rails for noobs
 
Assets Pipeline
Assets PipelineAssets Pipeline
Assets Pipeline
 
Debbug Rails Application For Dummies
Debbug Rails Application For DummiesDebbug Rails Application For Dummies
Debbug Rails Application For Dummies
 
развертывание среды Rails (антон веснин, Locum Ru)
развертывание среды Rails (антон веснин, Locum Ru)развертывание среды Rails (антон веснин, Locum Ru)
развертывание среды Rails (антон веснин, Locum Ru)
 
Фронтенд для рубиста
Фронтенд для рубистаФронтенд для рубиста
Фронтенд для рубиста
 
Deploy.rb, Ilya Zykin, Rails club2016
Deploy.rb, Ilya Zykin, Rails club2016Deploy.rb, Ilya Zykin, Rails club2016
Deploy.rb, Ilya Zykin, Rails club2016
 
R18n
R18nR18n
R18n
 
Rails Concerns
Rails ConcernsRails Concerns
Rails Concerns
 
Александр Тищенко - "Антикризисная презентация"
Александр Тищенко - "Антикризисная презентация"Александр Тищенко - "Антикризисная презентация"
Александр Тищенко - "Антикризисная презентация"
 
RSpec. Part 1
RSpec. Part 1RSpec. Part 1
RSpec. Part 1
 
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
Alexander Dymo - RubyConf 2014 - Ruby Performance Secrets and How to Uncover ...
 
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
 
Why does code style matter?
Why does code style matter?Why does code style matter?
Why does code style matter?
 
Refactorings with RubyMine
Refactorings with RubyMineRefactorings with RubyMine
Refactorings with RubyMine
 
Immutable servers with Packer/Chef/AWS
Immutable servers with Packer/Chef/AWSImmutable servers with Packer/Chef/AWS
Immutable servers with Packer/Chef/AWS
 
Системное тестирование приложений на Ruby on Rails с применением Rspec и Cap...
Системное тестирование  приложений на Ruby on Rails с применением Rspec и Cap...Системное тестирование  приложений на Ruby on Rails с применением Rspec и Cap...
Системное тестирование приложений на Ruby on Rails с применением Rspec и Cap...
 
Rails for dummies
Rails for dummiesRails for dummies
Rails for dummies
 
Errbit - агрегатор сбоев в продакшене
Errbit - агрегатор сбоев в продакшенеErrbit - агрегатор сбоев в продакшене
Errbit - агрегатор сбоев в продакшене
 
Отладка и эксплуатация Rails-приложений
Отладка и эксплуатация Rails-приложенийОтладка и эксплуатация Rails-приложений
Отладка и эксплуатация Rails-приложений
 
Разрушаем негативные мифы Ruby, Rails.
Разрушаем негативные мифы Ruby, Rails.Разрушаем негативные мифы Ruby, Rails.
Разрушаем негативные мифы Ruby, Rails.
 

Recently uploaded

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

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;
  • 9. Automated server configuration is the future (IMO)
  • 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

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n