getchef.com ◦ @chef • a product (with paid support) ◦ packages, not recommended install from gemfiles • an open source project • a community (open source but not only)
but very reliable (daily used, very difficult to extend for an outsider) ubuntu ruby18-webapp-related recipes to newer ones 2. proof of concept to migrate chef09 company’ s repository to anything better
cookbook approach 4. Everything is a cookbook 5. Production Cookbook Deployment 6. Production Cookbook Development 7. Opscode packages 8. Developers’ isolated ruby environment 9. Final Steps 10. Conclusions
Modify and test undocumented chef-server config, with some “little” external problems: - shared server behind a VPN - unavailable ports: reassign 80/443 to 81/8443 - 8000 not opened in firewall (so no reports will be available)
because Multiproject! • http://learn.getchef.com • Berkshelf helped a lot with dependencies (**) • Good practices freezing versions (*) not open-source (limited to 10 nodes) (**) not so easy when not opscode server
• The Test Kitchen integration testing framework. • ChefSpec, for unit testing cookbooks. • Foodcritic, static code analysis on cookbooks. • All of the Chef tools you're already familiar with: Chef Client, Knife, Ohai and Chef Zero.
for tests nor TDD (to learn about) • Not enough RAM in laptop nor in AWS micro instances for making testing/CI with Vagrant • Foodcritic and more, but later • I hope to use them ASAP: just because I like it. The same with Puppet.
risks, quick tests, quickwin, try and try • think in advance, virtualhosts library • ugly code you know it will be easy to change • the community code is better than yours • extend, not create from the ground • parametrize cookbooks: redis
recipes and cookbooks against a new chef organization in opscode free hosting. • install, fix, check-apply and repeat in frontend staging instances (Poor’s man plan–do–check–adjust) https://en.wikipedia.org/wiki/PDCA
/usr/bin and gems in its own gemsdir • REMOVE any puppet or ruby preexistent package or binary, no interferences please! • BEWARE: never use binaries without explicit PATH e.g. /opt/chef/bin/chef-client
rubies installed (1.9.3 & 2.0.X) • unprivileged users will install its own gems, without interfering with chef ruby-binaries SOLUTION: compile explicit versions from source code, rewrite PATH in user environment and install “bundler gem” as root.
2.1 ruby • install passenger-apache library+binary compiled and installed as a gem under chef. rpm gemlib path (a community recipe is in charge of it) • compatible to both 2.0.x and 1.9.x user rubies
2.0.X) in appropriate virtualhost apache files (from templates) NOTE: Foodcritic tool helped a lot when looking for errors (e.g. specially with chef templates)
worked ok. Traditional approach to development: logrotate and monit forked recipes with “999” suffix added to “semver” in metadata.rb • not perfect • Explicit installation of dependencies when in Opensource Opscode server
more weeks with “fringes” • create new organization in opscode free account • chef-solo-search for “local” databags • BIG CRISIS: no chef-server available -> chef-solo deployment
2 weeks) • install explicit dependencies • “chef cookbook site install” • only needed “ancient” (fork and modify) approach in two cookbooks: monit and passenger
Monolithic cookbook refactored as 3 cookbooks Three layers of attribute+template files: • general cookbook (i.e. language, servers,...) ◦ company cookbook (i.e. final customer specific) ▪ project cookbook (i.e. virtualhost config)
no way to configure staging chef-server (only working through 127.0.0.1 and VPN) ◦ no way to configure ubuntu from opscode deb packages • You need big motivation to success